-
Notifications
You must be signed in to change notification settings - Fork 8
Conversation
d3353e3
to
2c7a994
Compare
@@ -102,6 +107,33 @@ public function getTags() | |||
/** | |||
* {@inheritdoc} | |||
*/ | |||
public function add($path, $resource) |
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.
rm
2c7a994
to
5dae52e
Compare
5dae52e
to
8a295bd
Compare
8a295bd
to
10f0b7e
Compare
// if the query does not contain a glob pattern, then it applies to an | ||
// explicit node and we should throw an exception if it is not found. | ||
if (false === $this->globHelper->isGlobbed($query) && 0 === count($nodes)) { | ||
throw new ResourceNotFoundException($query); |
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.
Not sure if we should throw an exception if an explicit node was specified but not found (as here) or always throw an exception if zero nodes are found. /cc @wouterj @webmozart
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.
Actually meant this as a coment on move
-- I see that for remove
the number of items is returned. We can simply return the number of nodes found by the finder.
a56e0db
to
eeff6f3
Compare
$this->session->save(); | ||
} | ||
|
||
private function doMoveNodes($nodes, $sourceQuery, $targetPath) |
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.
Should be safe to type-hint on array
here as the finder
seems to only return arrays of things.
cbbbc78
to
202bdfd
Compare
@wouterj @ElectricMaxxx I am reasonably happy with this, so feel free to review. I will move onto the ResourceBundle now. |
202bdfd
to
318a42e
Compare
318a42e
to
c12c5cf
Compare
* | ||
* @author Maximilian Berghoff <[email protected]> | ||
*/ | ||
interface EditableRepository extends EditableRepository |
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.
I think you should alias the second one.
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.
Hmm, yeah. Somehow strange that that even works.
On Thu, Jun 02, 2016 at 07:56:46AM -0700, Maximilian Berghoff wrote:
In [1]Repository/Api/EditableRepository.php:
- * file that was distributed with this source code.
- /
+
+namespace Symfony\Cmf\Component\Resource\Repository\Api;
+
+use InvalidArgumentException;
+use Puli\Repository\Api\EditableRepository;
+use Puli\Repository\Api\UnsupportedLanguageException;
+
+/*- * Extends the Puli editable repository to implement the as-of-yet not
- * implemented features.
- * @author Maximilian Berghoff [email protected]
- */
+interface EditableRepository extends EditableRepositoryI think you should alias the second one.
—
You are receiving this because you authored the thread.
Reply to this email directly, [2]view it on GitHub, or [3]mute the thread.Reverse link: [4]unknown
References
Visible links
- [WIP] Support for move and remove #23 (comment)
- https://github.com/symfony-cmf/resource/pull/23/files/c12c5cf7b1de0cbf2bcb789fffc4610038aa5567#r65555686
- https://github.com/notifications/unsubscribe/AAgZccdL1mCPtwD8BOrwyN4p1roz7Bxmks5qHu8ugaJpZM4IsYhH
- https://github.com/symfony-cmf/resource/pull/23/files/c12c5cf7b1de0cbf2bcb789fffc4610038aa5567#r65555686
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.
travis say it does not:
PHP Fatal error: Cannot declare class
Symfony\Cmf\Component\Resource\Repository\Api\EditableRepository because
the name is already in use in
/home/travis/build/symfony-cmf/resource/Repository/Api/EditableRepository.php
on line 24
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.
It seems that PHP7 doesn't care about that. Fixed now for PHP5.
b580149
to
6425f09
Compare
|
||
private function doMoveNodes(array $nodes, $sourceQuery, $targetPath) | ||
{ | ||
if (false === $this->isGlobbed($sourceQuery)) { |
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.
if it's not globbed, wouldn't it not always result in $nodes
containing just one element? In other words, why can't we simply loop through $nodes
like done in removeNodes()
?
Nvm, I spotted the difference now.
How are we going to handle supported moves? E.g. some documents cannot have children or a Menu document cannot not Content childs, etc. This has to be implemented both on the client side (this bundle?) and the TreeBrowserBundle (to indicate to the user if a drop is allowed) |
We are working on this by introducing child restrictions to the PHPCR-ODM. This would allow use to add descriptors to describe valid children types and also links to create new children. We may later want to add more control at the tree-browser level, but for now I think that would be OK? |
The move target has to exists. This means that we can't move resources to a new node. Is this expected behaviour? I kinda think it is. |
Takes over from #17
Adds move and remove operations.
It builds on the PR of @ElectricMaxxx and:
add
method (we can perhaps add it later if it makes sense).