/** * Remove instance from database * * @param integer $id * @return bool */ public function removeInstance($id) { $instance = $this->CollectionInstance->find($id); // should we remove all the fields of this instance here? return $instance ? $instance->delete() : false; }
/** * Remove instance from database * * @param integer $id * @return bool */ public function removeInstance($id) { $instance = $this->CollectionInstance->find($id); $this->Field->where('collection_instance_id', $id)->forceDelete(); return $instance ? $instance->delete() : false; }
public function test_it_creates_collection_fields_from_an_instance() { $instance = \DvsCollectionInstance::find(1); $output = $this->CollectionFieldFactory->createFromCollectionInstance($instance); assertEquals('awesome', $output->key1->bar); }