-
Notifications
You must be signed in to change notification settings - Fork 8
Conversation
* Value is an array. | ||
*/ | ||
const CHILDREN_TYPES = 'children.types'; | ||
const CHILDREN_ALLOW = 'children.allow'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See #25 for a possible alternative to this system of enhancement by using vendor-provided objects as descriptors.
c520f48
to
4215a1d
Compare
👍 However, the fun begins when using interfaces (and we probably need to use interfaces), as the tree browsers have to become aware of the implementation of the interfaces. |
Well, we would have the standard descriptor classes, ( |
@dantleech well, I mainly meant using interfaces for the allowed child class configuration. We have to use interfaces, in order to allow custom documents created by the users. But JavaScript isn't aware if |
ah I see. not sure i see the problem though - the "allowed type" is just the "payload type", that it happens to be a class in this case shouldn't matter to the JS. All (CMF) resources have a payload type. Sorry if I missed the point. |
@dantleech in the tree browser, this allowed child option will be used to (a) determine if I can drag 'n drop a specific document as child or (b) determine which documnts I can create when doing right click -> create. Assume I drag an |
@wouterj now i see. Maybe we should splurge the interfaces and parent types into the descriptor also? |
Updated to explode the allowed classes to concrete mapped instances. |
fda9cdf
to
1f8c822
Compare
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Symfony\Cmf\Component\Resource\Description\Enhancer\Doctrine\PhpcrOdm; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Namespace should not have PhpcrOdm
036e444
to
d0562f9
Compare
public function testNotSupportsNotSupportedByPhpcrOdm() | ||
{ | ||
$this->cmfResource->getPayloadType()->willReturn(\stdClass::class); | ||
$this->metadataFactory->hasMetadataFor(\stdClass::class)->willReturn(true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why this?
d0562f9
to
84e8bad
Compare
/cc @wouterj so now the descriptor returns all concrete mapped classes that are instances of the allowed children, e.g. if the document allows
|
84e8bad
to
85ca078
Compare
@@ -42,13 +46,31 @@ | |||
const LINK_SHOW_HTML = 'link.show.html'; | |||
const LINK_LIST_HTML = 'link.list.html'; | |||
|
|||
const LINKS_CREATE_CHILD_HTML = 'links.create_child.html'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add cmment
Will fix my comments and merge tomorrow if no objections. |
b51a5b6
to
96c72ef
Compare
96c72ef
to
12d11f2
Compare
- Explode class metadata - Do not generate for non-existing routes - Added support for children links (Sylius)
12d11f2
to
f1368ec
Compare
This PR adds an enhancer for the PHPCR-ODM in which supporting child types are added to the Description.
This will allow for resource browsers to know which types can be added to any given node.
/cc @wouterj @dbu
(note it depends on https://github.com/doctrine/phpcr-odm/pull/706/commits)