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;
 }
 public function copy(Container $parent, $new_name)
 {
     if ($new_name == "") {
         throw new e\EmptyNameException(c\M::EMPTY_NAME);
     }
     $service = $this->getService();
     $self_identifier = $service->createId($this->getType(), $this->getId());
     $service->copy($self_identifier, $parent->getIdentifier(), $new_name, false);
     if ($service->isSuccessful()) {
         $parent->reloadProperty();
         // get info of new child
         $parent = $parent->getProperty();
         $children = $parent->children->child;
         $child_count = count($children);
         if ($child_count == 1) {
             $children = array($children);
         }
         // look for the new child
         foreach ($children as $child) {
             $child_path = $child->path->path;
             $child_path_array = explode('/', $child_path);
             if (in_array($new_name, $child_path_array)) {
                 $child_found = $child;
                 break;
             }
         }
         // get the digital id of child
         $child_id = $child_found->id;
         // return new block object
         return Asset::getAsset($service, $this->getType(), $child_id);
     } else {
         throw new e\CopyErrorException(c\M::COPY_ASSET_FAILURE . $service->getMessage());
     }
 }