private function getEntry(a\Asset $a) { if (count($this->acl_entries) > 0) { foreach ($this->acl_entries as $entry) { if ($entry->getType() == $a->getType() && $entry->getName() == $a->getName()) { return $entry; } } } return NULL; }
public function moveAsset(Asset $a, Container $new_parent) { if ($a == NULL || $new_parent == NULL) { throw new e\NullAssetException(S_SPAN . c\M::NULL_ASSET . E_SPAN); } if ($a->getParentContainer()->getId() == $new_parent->getId()) { throw new e\RenamingFailureException(S_SPAN . c\M::SAME_CONTAINER . E_SPAN); } $this->service->move($a->getIdentifier(), $new_parent->getIdentifier(), $a->getName(), false); if (!$this->service->isSuccessful()) { throw new e\RenamingFailureException(S_SPAN . c\M::RENAME_ASSET_FAILURE . E_SPAN); } return $this; }