/** * @brief add a new media object to collection * * @param MediaObjectInterface * * @return the added object */ public function addObject(MediaObjectInterface $object) { $this->orm->objects()->attach($object->getId()); return $object; }
/** * @brief create a new collection * * @param collection name * * @return CollectionInterface */ public function create($name) { $this->collection->unguard(); $collection = $this->collection->create(array('name' => $name)); return new CollectionEloquent($collection); }