示例#1
0
 /**
  * This will override the given model which means it will be deleted
  * from database...
  *
  * @param Model $model
  */
 public function override(Model $model)
 {
     if ($model->doesUse('Ordered')) {
         // Set the order to the same model order
         $this->setOrder($model->getOrder());
         $model->delete();
     }
 }
示例#2
0
 /**
  * @param string $key
  * @return mixed|void
  */
 public function getAttribute($key)
 {
     if (!($value = parent::getAttribute($key))) {
         return $this->getInfo($key);
     }
     return $value;
 }
示例#3
0
 /**
  * @param Model $model
  * @return bool
  */
 public function same(Model $model)
 {
     return $model->getClass() == $this->getClass() and $model->id == $this->id;
 }