Example #1
0
 public function valueGet(Base $entity = null)
 {
     if (!$entity) {
         return null;
     }
     $value = $entity->get($property);
     // got a processor
     if ($this->processor and is_callable($this->processor)) {
         $value = call_user_func($this->processor, $value);
     }
     return $value;
 }
Example #2
0
 /**
  * Set PgLargeObject on entity
  * @param PgLargeObject $value
  * @return PgLargeObject
  */
 public static function set_PgLargeObject($value, $inputValidate, Base $entity)
 {
     if ($value instanceof PgLargeObject) {
         return $value;
     }
     if (is_intish($value)) {
         $value = new Oid($value, $entity->r()->db);
     }
     return is_null($value) ? null : new PgLargeObject($value);
 }
Example #3
0
 /**
  * Get chain tasks
  * @param Bond\Entity\Base $entity
  * @param array $chainTasks
  * @param array $columns
  * @return null
  */
 protected static function buildChainTasks(\Bond\Entity\Base $entity, $columns)
 {
     $tasks = array();
     foreach ($columns as $column) {
         $value = $entity->get($column);
         // chain saving
         if (is_object($value) and $value instanceof ChainSavingInterface) {
             $value->chainSaving($tasks, $column);
         }
     }
     return $tasks;
 }