Quiz
4.3 Models, Repositories and Relations
Fragen in diesem Quiz (21)
1Which of the following statements about domain models in Extbase is correct? (1)
- AThree different basis objects exist: entity, value object and factory
- BProperties of models should be accessed and modified directly
- CA “getter” method should be used to access a property
- DThe visibility of domain model properties in Extbase should be public
- EAll options listed above are wrong
2What is required in an Extbase repository to prevent it from returning deleted records? (1)
- AThe TypoScript setting setup.tx_extbase.view.hidden = 0 must be set
- BThe query setting setIncludeDeleted(false) must be set
- CThe parameter true must be passed to the repository method findAll()
- DThe parameter true must be passed to the repository method execute()
- ENothing: the repository does not return deleted records by default
3What needs to be done in an Extbase repository to include hidden and deleted records in the result set? (1)
- AThis is not possible. Deleted records are removed from the database
- BBoth query settings setIncludeHidden() and setIncludeDeleted() need to be set to true
- CBoth query settings setIgnoreEnableFields() and setEnableFieldsToBeIgnored() need to be
set appropriately - DThe TCA configuration ['ctrl']['ignoreEnableFields'] of the table need to be set to true
4Which type of relation is not possible with TCA’s inline field type (IRRE)? (1)
- A1:n
- Bn:1
- C1:1
- Dm:n
- EIRRE supports all types of relations
5Which property annotation is required to define a relation of type 1:n in your domain model? (1)
- A/**
* @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage
*/ - B/**
* @var \Foo\Bar\Domain\Model\Post
*/ - C/**
* @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\Foo\Bar\Domain\Model\Post>
*/ - D/**
* @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage[\Foo\Bar\Domain\Model\Post]
*/ - E/**
* @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage<1:n><\Foo\Bar\Domain\Model\Post>
*/
- A/**
6Which repository method tests whether the value of a domain model property, which has a m:n relation, contains a specific value? (1)
- Ain()
- Bbetween()
- Ccontains()
- Dis()
- Einbetween()
7Which repository method tests whether the value of a domain model property is included in a list of possible
values? (1)- Ain()
- Bbetween()
- Ccontains()
- Dis()
- Einbetween()
8What needs to be configured to instruct all methods of a repository to return results ordered by a specific property? (1)
- AThis can be achieved in a TypoScript file.
- BBy passing the parameter $order in the method’s signature
- CBy adding the @sort annotation to the domain model
- DBy setting the $defaultOrderings property in the repository class
- EBy adding an appropriate sortby property to the TCA
9Which statements about the following code snippet are correct? (2)
<?php
namespace Vendor\MyExtension\Domain\Repository;
use \TYPO3\CMS\Extbase\Persistence\Repository;
use \TYPO3\CMS\Extbase\Persistence\QueryInterface;
class ExampleRepository extends Repository
{
protected $defaultOrderings = [
'title' => QueryInterface::ORDER_DESCENDING
];
...
}- ARecords read from this repository are sorted by their title field in descending order by default
- BThe additional configuration sortBy is required in the TCA of the repository to set the default sort order
- CThe property $defaultOrderings has no effect by default
- DThe constant ORDER_ASCENDING can be used instead of ORDER_DESCENDING to sort in ascending order
- EIf the property $defaultOrderings would not exist, the repository would use the sorting
defined in the TCA
10Assuming two domain objects Book and Chapters exist, which have a 1:n-relation. How can you determine all chapters of a book which match a search string? (1)
- ABy searching in the Book repository and by using in() on the property chapters
- BBy searching in the Book repository and by using contains() on the property chapters
- CBy searching in the Chapters repository and by using in() on the property books
- DBy searching in the Chapters repository and by using contains() on the property books
- EBy searching in the Chapters repository and iterating all records to find the appropriate
chapters
11What needs to be configured to access records from the repository stored on page UID = 0? (1)
- ANothing needs to be configured as this is the default
- BThe query setting in the repository must be set explicitly: setStoragePageIds([0])
- CThis feature needs to be enabled in the repository explicitly: setEnableRootPage(true)
- DWhen the query is executed, the page UID must be passed as an argument in the function call: execute(0)
- ERecords on page UID = 0 can not be accessed as a general rule
12What needs to be configured to access all records, regardless of which page they are stored on? (1)
- ANothing needs to be configured as this is the default
- BThe TypoScript configuration persistence.storagePid needs to be set to all
- CThe page restriction needs to be lifted by using the Restriction Builder
- DThe query setting in the repository must be set explicitly: setRespectStoragePage(false)
13How can a custom extension access the fe_users database table? (2)
- ABy extending the domain model TYPO3\CMS\Extbase\Domain\Model\FrontendUser
- BBy adding the mapping as TypoScript
- CBy adding the mapping as TSconfig
- DBy extending the fe_users TCA appropriately
- EThe only option is to frequently copy the content of table fe_users into a custom table via a cron-job
14Which statement about the Persistence Manager is correct? (1)
- AThe Persistence Manager is loaded in the controller automatically and can be used in custom scripts
- BThe Persistence Manager is loaded in the repository automatically and can be used in custom scripts
- CBy using the Persistence Manager, a single object or all objects can be made persistent
- DThe Persistence Manager is an internal method of Extbase which is not part of the public API
- EThe Persistence Manager is of type “prototype”
15How can you access TypoScript settings within a domain model? (1)
- AVia $this->setting
- BVia $this->settings
- CVia $this->typoscript
- DVia $this->config
- ENone of the options above
16What is the recommended way to access TypoScript settings in a repository? (1)
- AIt’s recommended to access TypoScript configuration from the controller only
- BIt’s recommended to access TypoScript configuration by using the Object Manager
- CIt’s recommended to access TypoScript configuration by using the Settings Manager
- DTypoScript settings can be accessed by using $this->settings directly
- ETypoScript settings can be accessed by using $settings directly
17Which statments about the following TypoScript code are correct? (2)
plugin.tx_myextension {
persistence {
classes {
Vendor\MyExtension\Domain\Model\Client {
mapping {
tableName = fe_users
columns {
first_name.mapOnProperty = name
}
}
}
}
}
}- AThe code has no effect: a fully qualified class name must be used as a tableName value
- BThe property name of the model Client maps to the field first_name of the database table
fe_users - CThe code has no effect: table and attribute names have to be written in UpperCamelCase
- DOnly one property can be mapped between two tables
- EAll properties are mapped by default if their name scheme matches
18A domain model has a relation parent to itself. Is it possible to access the relation via the Query Manager? (1)
- AYes, this is possible without any configuration
- BYes, if the relation has the annotation @selfreference
- CYes, if the TypoScript key features.selfreference = 1 is set
- DThis is not possible – no error message is generated
- EThis is not possible – an error message is generated
19How can we make a TypoScript object available in a controller? (1)
- AVia $this->configurationManager->getContentObject()->data
- BVia $this->cObj
- CBy utilising the “ContentObjectRenderer”
- DBy utilising the “ContentObjectModel”
- EThis is not possible in a controller
20Is it possible to use stdWrap in Extbase TypoScript settings as shown below? (1)
plugin.tx_myextension_example {
settings {
uid.dataWrap = {page:uid}
}
}- AYes, this is supported out-of-the-box
- BYes, but this needs to be activated in the Extbase configuration
- CYes, you have to use PHP code to process stdWrap functions
- DYes, but extbaseWrap must be used instead of dataWrap
- ENo, this is not supported and not possible at all
21What are “Switchable Controller Actions”? (2)
- AAn option to limit which controller-action-combinations are executable
- BAn option to switch between actions at run time
- CAn option to control the sort order of actions shown in the backend
- DA configuration option to switch between backend users
- EAn option to switch between controllers, based on actions
Informationen
- Beschreibung
- Der Nutzer hat seine Fachbereichs-Information gelöscht. Quiz am 4.3 Models, Repositories and Relations, erstellt von Gelöschter Nutzer am 27/04/2022.
- Autor
- Gelöschter Nutzer
- Sprache
- English
- Aufrufe
- 21
- Verlauf
- Erstellt am 27 Apr 2022 · aktualisiert am 27 Apr 2022
- Schlagwörter
- Bewertung
- Noch keine Bewertungen Bewerte dieses Quiz