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
 /**
  * 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;
 }