Пример #1
0
 /**
  * Short description of method toArray
  *
  * @access public
  * @author Joel Bout, <*****@*****.**>
  * @return array
  */
 public function toArray()
 {
     $returnValue = array();
     $returnValue = parent::toArray();
     $returnValue['prop'] = $this->property->getUri();
     return (array) $returnValue;
 }
 /**
  * Get items of a specific model
  * @param string|core_kernel_classes_Resource $itemModel - the item model URI
  * @return core_kernel_classes_Resource[] the found items
  */
 public function getAllByModel($itemModel)
 {
     if (!empty($itemModel)) {
         $uri = $itemModel instanceof core_kernel_classes_Resource ? $itemModel->getUri() : $itemModel;
         return $this->itemClass->searchInstances(array($this->itemModelProperty->getUri() => $uri), array('recursive' => true));
     }
     return array();
 }
 /**
  * get the executions of this activity
  *
  * @access public
  * @author Somsack Sipasseuth, <*****@*****.**>
  * @param  Resource activity
  * @param  Resource processExecution
  * @return array
  */
 public function getExecutions(core_kernel_classes_Resource $activity, core_kernel_classes_Resource $processExecution)
 {
     $returnValue = array();
     if (!is_null($activity) && !is_null($processExecution)) {
         $filters = array(PROPERTY_ACTIVITY_EXECUTION_ACTIVITY => $activity->getUri(), $this->processExecutionProperty->getUri() => $processExecution->getUri());
         $clazz = new core_kernel_classes_Class(CLASS_ACTIVITY_EXECUTION);
         $options = array('recursive' => 0, 'like' => false);
         foreach ($clazz->searchInstances($filters, $options) as $activityExecution) {
             $returnValue[$activityExecution->getUri()] = $activityExecution;
         }
     }
     return (array) $returnValue;
 }
 /**
  * Short description of method getNotificationsToSend
  *
  * @access public
  * @author Somsack Sipasseuth, <*****@*****.**>
  * @return array
  */
 public function getNotificationsToSend()
 {
     $returnValue = array();
     //get the notifications with the sent property to false
     $notifications = $this->notificationClass->searchInstances(array($this->notificationSentProp->getUri() => GENERIS_FALSE), array('like' => false, 'recursive' => 0));
     foreach ($notifications as $notification) {
         //there a date prop by sending try. After 4 try, we stop to try (5 because the 4 try and the 1st date is the creation date)
         $dates = $notification->getPropertyValues($this->notificationDateProp);
         if (count($dates) < 5) {
             $returnValue[] = $notification;
         }
     }
     return (array) $returnValue;
 }
 /**
  * Short description of method getDefaultFilePath
  *
  * @access public
  * @author Somsack Sipasseuth, <*****@*****.**>
  * @return string
  */
 public function getDefaultFilePath()
 {
     $returnValue = (string) '';
     $returnValue = tao_helpers_Uri::getUniqueId($this->ownerInstance->getUri()) . '/' . tao_helpers_Uri::getUniqueId($this->property->getUri());
     return (string) $returnValue;
 }