Пример #1
0
 /**
  * 
  * Deletes the cache for this model and all related models.
  * 
  * @return void
  * 
  */
 public function deleteAll()
 {
     $this->delete();
     foreach ($this->_model->related as $name => $info) {
         $model = $this->_model->getRelated($name)->getModel();
         $model->cache->delete();
     }
 }
Пример #2
0
 /**
  * 
  * Create a new record related to this one.
  * 
  * @param string $name The relation name.
  * 
  * @param array $data Initial data
  * 
  * @return Solar_Sql_Model_Record
  * 
  */
 public function newRelated($name, $data = null)
 {
     $related = $this->_model->getRelated($name);
     $new = $related->fetchNew($data);
     return $new;
 }