Example #1
0
 /**
  * Removes a photo or list of photos from the set
  * 
  * @return null
  * @param $photo a ComPhotosDomainEntityPhoto object
  */
 public function removePhoto($photo)
 {
     $photos = AnHelperArray::getIterator($photo);
     foreach ($photos as $photo) {
         if ($edge = $this->photos->find($photo)) {
             $edge->delete();
         }
     }
 }
Example #2
0
 /**
  * add locations to a locatable node
  *
  * @param entity set of location entities
  */
 public function addLocation($locations)
 {
     $newItems = AnHelperArray::getIterator($locations);
     foreach ($newItems as $item) {
         if (!$this->locations->find($item)) {
             $this->locations->insert($item);
         }
     }
     return $item;
 }