Repository/controller: How can I force TYPO3 to load the field "sorting"?

lampshade

In a controller/template I'd like to have access to the field sorting of an entity.

I've tried to access it like:

$category->getSorting();

But it fails, as the method does not exist. When I dump the entity, all those meta fields, like hidden, starttime etc. aren't listed at all.

How can I tell TYPO3 to load those fields along with the other fields of the entitiy?

Daniel

Since you are in Extbase context, you have to add the property to your model or (if you use the model of another extension) extend it and add the property. In both cases a getter and a setter method is needed if you want to access and edit the properties value:

/**
 * @var integer
 */
protected $sorting;

public function setSorting($sorting) {
    $this->sorting = $sorting;
}

public function getSorting() {
    return $this->sorting;
}

Make sure you have that field configured in the TCA as well:

...
'columns' => array(
    'sorting' => array(
        'label' => 'sorting',
        'config' => array(
            'type' => 'passthrough'
        )
    ),
    ...

After this you should be able to access the sorting property.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Repository/controller: How can I force TYPO3 to load the field "sorting"?

From Dev

How can I validate a select field with a bound object in TYPO3?

From Dev

TYPO3 displayCond: How can i specify additional optional conditions of the same field?

From Dev

How can I avoid datetime problems in TYPO3?

From Dev

How can I store a datetime property in TYPO3?

From Dev

How can I get a correct publish date in TYPO3?

From Dev

How can I read lines from a file in Typo3?

From Dev

How can I perform a join statement with extbase in TYPO3?

From Dev

How can i disable the default NodeTypes in TYPO3 Neos?

From Dev

How can I read lines from a file in Typo3?

From Dev

How can I get a correct publish date in TYPO3?

From Dev

How can I force a TabItem to initialize content on load?

From Dev

How can I force load a proxy object in NHibernate?

From Dev

How can I force a struct's field to always be immutable in Rust?

From Dev

How can I implement a multi join in Typo3 via userfunction?

From Dev

How can I pass an object to a specific view on a another page in TYPO3?

From Dev

TYPO3 How can I add own data (datafields) into tt_address?

From Dev

Typo3 Extbase How can I get all Objects with a relation = x?

From Dev

how can i implement date conversions in typo3 repository methods

From Dev

How can I send a base64 encoded image with TYPO3

From Dev

how can i implement date conversions in typo3 repository methods

From Dev

How can I change Typo3 BodyTag, when a constant is not empty

From Dev

TYPO3: How can I translate content elements within articles for news?

From Dev

TYPO3: How can I redirect to the translated homepage of a non translated page?

From Dev

How can I tell TYPO3 to not Cache so it does update database values

From Dev

How can I hide create new button in TYPO3 TCA type inline?

From Dev

How can I remove an override check button in TYPO3 TCA

From Dev

How can I add a new Layout to the new Form Ext. on TYPO3 8.7?

From Dev

How can I get the TYPO3 "appearance" media images by using "ViewHelper"?

Related Related

  1. 1

    Repository/controller: How can I force TYPO3 to load the field "sorting"?

  2. 2

    How can I validate a select field with a bound object in TYPO3?

  3. 3

    TYPO3 displayCond: How can i specify additional optional conditions of the same field?

  4. 4

    How can I avoid datetime problems in TYPO3?

  5. 5

    How can I store a datetime property in TYPO3?

  6. 6

    How can I get a correct publish date in TYPO3?

  7. 7

    How can I read lines from a file in Typo3?

  8. 8

    How can I perform a join statement with extbase in TYPO3?

  9. 9

    How can i disable the default NodeTypes in TYPO3 Neos?

  10. 10

    How can I read lines from a file in Typo3?

  11. 11

    How can I get a correct publish date in TYPO3?

  12. 12

    How can I force a TabItem to initialize content on load?

  13. 13

    How can I force load a proxy object in NHibernate?

  14. 14

    How can I force a struct's field to always be immutable in Rust?

  15. 15

    How can I implement a multi join in Typo3 via userfunction?

  16. 16

    How can I pass an object to a specific view on a another page in TYPO3?

  17. 17

    TYPO3 How can I add own data (datafields) into tt_address?

  18. 18

    Typo3 Extbase How can I get all Objects with a relation = x?

  19. 19

    how can i implement date conversions in typo3 repository methods

  20. 20

    How can I send a base64 encoded image with TYPO3

  21. 21

    how can i implement date conversions in typo3 repository methods

  22. 22

    How can I change Typo3 BodyTag, when a constant is not empty

  23. 23

    TYPO3: How can I translate content elements within articles for news?

  24. 24

    TYPO3: How can I redirect to the translated homepage of a non translated page?

  25. 25

    How can I tell TYPO3 to not Cache so it does update database values

  26. 26

    How can I hide create new button in TYPO3 TCA type inline?

  27. 27

    How can I remove an override check button in TYPO3 TCA

  28. 28

    How can I add a new Layout to the new Form Ext. on TYPO3 8.7?

  29. 29

    How can I get the TYPO3 "appearance" media images by using "ViewHelper"?

HotTag

Archive