Feature #3933

Support typed parameters for class schemata, persistence, validation

Added by Karsten Dambekalns about 6 years ago. Updated almost 5 years ago.

Status:Resolved Start date:2009-07-17
Priority:Must have Due date:
Assigned To:Karsten Dambekalns % Done:

100%

Category:MVC
Target version:TYPO3 Flow Base Distribution - 1.0 alpha 3
PHP Version: Complexity:
Has patch:

Description

When a domain model contains an array member variable and expects objects (of a certain kind) in that array, this can currently not be validated automatically. Additionally request parameters cannot be mapped from UUIDs to objects in such cases (because the class schema knows only about the array type).

Solution: Implement typed array using a syntax inspired by Java's Generics so that class schemata can find out about the intended contents of an array:

    /**
     * @var array<\F3\Blog\Domain\Model\Post>
     */
    protected $relatedPosts = array();

That would limit $relatedPosts to values of type \F3\Blog\Domain\Model\Post.


Related issues

related to TYPO3.Flow - Feature #4146: Support typed parameters for validation Accepted

Associated revisions

Revision f446ab3a
Added by Karsten Dambekalns about 6 years ago

[+FEATURE] FLOW3 (Reflection): Class schemata now contain information about requested element types for collection-like properties, use @var type<elementType> annotations. Relates to #3933.

Revision 3dd9069e
Added by Karsten Dambekalns almost 7 years ago

[+FEATURE] FLOW3 (Property): When mapping properties UUIDs in arrays being mapped to typed array-like targets get converted to objects now. Relates to #3933.

History

#1 Updated by Robert Lemke about 6 years ago

  • Category set to MVC
  • Priority changed from Should have to Must have

#2 Updated by Karsten Dambekalns almost 6 years ago

  • Status changed from Accepted to Resolved
  • % Done changed from 0 to 100

Remaining work now shifted to #4146...

Also available in: Atom PDF