Skip to content

Commit

Permalink
Merge pull request #9 from jorisros/feature/create-by-path
Browse files Browse the repository at this point in the history
Feature/create by path
  • Loading branch information
jorisros authored Dec 23, 2016
2 parents 1770ee0 + 1f22c27 commit f92859e
Showing 1 changed file with 19 additions and 6 deletions.
25 changes: 19 additions & 6 deletions lib/Fixtures/Alice/Processor/WorkspaceProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,27 @@ class WorkspaceProcessor implements ProcessorInterface
public function preProcess($object)
{
if ($object instanceof Workspace\Object) {
$cPathObj = AbstractObject::getById($object->getCid());
$cPath = $cPathObj->getFullPath();
$object->setCpath($cPath);
if ($object->getCid()) {
$cPathObj = AbstractObject::getById($object->getCid());
$cPath = $cPathObj->getFullPath();
$object->setCpath($cPath);
} elseif ($object->getCpath()) {
$cIdObj = AbstractObject::getByPath($object->getCpath());
$cId = $cIdObj->getId();
$object->setCid($cId);
}

}
if ($object instanceof Workspace\Asset) {
$cPathObj = Folder::getById($object->getCid());
$cPath = $cPathObj->getFullPath();
$object->setCpath($cPath);
if ($object->getCid()) {
$cPathObj = Folder::getById($object->getCid());
$cPath = $cPathObj->getFullPath();
$object->setCpath($cPath);
} elseif ($object->getCpath()) {
$cIdObj = Folder::getByPath($object->getCpath());
$cId = $cIdObj->getId();
$object->setCid($cId);
}
}
}

Expand Down

0 comments on commit f92859e

Please sign in to comment.