itemClass = new core_kernel_classes_Class(TaoOntology::ITEM_CLASS_URI); $this->itemsServices = taoItems_models_classes_ItemsService::singleton(); } public function getRootClass() { return $this->itemClass; } protected function getClassService() { return $this->itemsServices; } public function delete($resource) { taoItems_models_classes_ItemsService::singleton()->deleteItem(new core_kernel_classes_Resource($resource)); //parent::delete($resource) return true; } /** * @param array parameters an array of property uri and values */ public function createFromArray(array $propertiesValues) { if (!isset($propertiesValues[OntologyRdfs::RDFS_LABEL])) { $propertiesValues[OntologyRdfs::RDFS_LABEL] = ""; } $type = isset($propertiesValues[OntologyRdf::RDF_TYPE]) ? $propertiesValues[OntologyRdf::RDF_TYPE] : $this->getRootClass(); $label = $propertiesValues[OntologyRdfs::RDFS_LABEL]; unset($propertiesValues[OntologyRdfs::RDFS_LABEL]); unset($propertiesValues[OntologyRdf::RDF_TYPE]); $itemContent = null; if (isset($propertiesValues[taoItems_models_classes_ItemsService::PROPERTY_ITEM_CONTENT])) { $itemContent = $propertiesValues[taoItems_models_classes_ItemsService::PROPERTY_ITEM_CONTENT]; unset($propertiesValues[taoItems_models_classes_ItemsService::PROPERTY_ITEM_CONTENT]); } $resource = parent::create($label, $type, $propertiesValues); if (isset($itemContent)) { $event = new ItemCreatedEvent($resource->getUri(), $itemContent); $this->getEventManager()->trigger($event); } return $resource; } }