コード例 #1
0
 /**
  * Short description of method delete
  *
  * @access public
  * @author Jerome Bogaerts, <*****@*****.**>
  * @param  Resource resource
  * @param  boolean deleteReference
  * @return boolean
  */
 public function delete(core_kernel_classes_Resource $resource, $deleteReference = false)
 {
     $returnValue = (bool) false;
     //delete all values of the property to delete
     if ($deleteReference) {
         $query = 'DELETE FROM "statements" WHERE "predicate" = ? AND ' . $this->getModelWriteSqlCondition();
         $returnValue = $this->getPersistence()->exec($query, array($resource->getUri()));
     }
     $returnValue = parent::delete($resource, $deleteReference);
     return (bool) $returnValue;
 }
コード例 #2
0
 /**
  * Short description of method getRange
  *
  * @access public
  * @author Jerome Bogaerts, <*****@*****.**>
  * @param  Resource resource
  * @return \core_kernel_classes_Class
  */
 public function getRange(\core_kernel_classes_Resource $resource)
 {
     $returnValue = null;
     $rangeProperty = new \core_kernel_classes_Property(RDFS_RANGE, __METHOD__);
     $rangeValues = array();
     $delegate = $this->getImpToDelegateTo($resource);
     if ($delegate instanceof Property) {
         // Use the smooth sql implementation to get this information
         // Or find the right way to treat this case
         $rangeValues = \core_kernel_persistence_smoothsql_Resource::singleton()->getPropertyValues($resource, $rangeProperty);
     } else {
         $rangeValues = $delegate->getPropertyValues($resource, $rangeProperty);
     }
     if (sizeOf($rangeValues) > 0) {
         $returnValue = new \core_kernel_classes_Class($rangeValues[0]);
     }
     return $returnValue;
 }