Skip to content

Commit 8f77d2e

Browse files
committed
[DOC] Fix example using in other extension FriendsOfTYPO3#495
1 parent acf43a2 commit 8f77d2e

File tree

1 file changed

+4
-4
lines changed
  • Documentation/Tutorials/UsageOfAddressRepository

1 file changed

+4
-4
lines changed

Documentation/Tutorials/UsageOfAddressRepository/Index.rst

+4-4
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,18 @@ All you need to do is adopt the following code to your needs:
1313
1414
<?php
1515
16-
$addressRepository = $this->objectManager->get(\FriendsOfTYPO3\TtAddress\Domain\Repository\AddressRepository::class);
16+
$addressRepository = GeneralUtility::makeInstance(\FriendsOfTYPO3\TtAddress\Domain\Repository\AddressRepository::class);
1717
1818
// single selection
1919
// which means: output addresses in given order
20-
$demand = $this->objectManager->get(\FriendsOfTYPO3\TtAddress\Domain\Model\Dto\Demand::class);
20+
$demand = new \FriendsOfTYPO3\TtAddress\Domain\Model\Dto\Demand();
2121
$demand->setSingleRecords('12,34'); // Ids of tt_address records;
2222
$addresses = $addressRepository->getAddressesByCustomSorting($demand);
2323
2424
// list action
25-
$demand = $this->objectManager->get(\FriendsOfTYPO3\TtAddress\Domain\Model\Dto\Demand::class);
25+
$demand = new \FriendsOfTYPO3\TtAddress\Domain\Model\Dto\Demand();
2626
$demand->setPages(['12']); // list of pages where records are saved
27-
$demand->setCategories('1,3') // list of categories desired address records need to be assigned to
27+
$demand->setCategories('1,3'); // list of categories desired address records need to be assigned to
2828
$demand->setCategoryCombination('or'); // combine given categories either by "or" or "and"
2929
$demand->setSortBy('last_name'); // order field
3030
$demand->setSortOrder('asc');

0 commit comments

Comments
 (0)