/**
  * Short description of method createProperty
  *
  * @access public
  * @author Jerome Bogaerts, <*****@*****.**>
  * @param  Class clazz
  * @param  string label
  * @param  string comment
  * @param  boolean isLgDependent
  * @param  string uri
  * @return core_kernel_classes_Property
  */
 public static function createProperty(core_kernel_classes_Class $clazz, $label = '', $comment = '', $isLgDependent = false, $uri = '')
 {
     $returnValue = null;
     $property = new core_kernel_classes_Class(RDF_PROPERTY);
     $propertyInstance = self::createInstance($property, $label, $comment, $uri);
     $returnValue = new core_kernel_classes_Property($propertyInstance->getUri());
     if (!$returnValue->setDomain($clazz)) {
         throw new common_Exception('An error occured during Property creation.');
     } else {
         $returnValue->setLgDependent($isLgDependent);
     }
     return $returnValue;
 }
Exemple #2
0
 /**
  * (non-PHPdoc)
  * @see core_kernel_persistence_ClassInterface::createProperty()
  */
 public function createProperty(core_kernel_classes_Class $resource, $label = '', $comment = '', $isLgDependent = false)
 {
     $returnValue = null;
     $property = new core_kernel_classes_Class(RDF_PROPERTY, __METHOD__);
     $propertyInstance = $property->createInstance($label, $comment);
     $returnValue = new core_kernel_classes_Property($propertyInstance->getUri(), __METHOD__);
     $returnValue->setLgDependent($isLgDependent);
     if (!$returnValue->setDomain($resource)) {
         throw new common_Exception('problem creating property');
     }
     return $returnValue;
 }