コード例 #1
0
 public function dependentModelRowUpdated(Kwf_Model_Row_Abstract $row, $action)
 {
     parent::dependentModelRowUpdated($row, $action);
     $models = array($this);
     $models = array_merge($models, $this->_proxyContainerModels);
     foreach ($models as $model) {
         foreach ($model->_exprs as $column => $expr) {
             if ($expr instanceof Kwf_Model_Select_Expr_Parent) {
                 if ($model->getReferencedModel($expr->getParent()) === $row->getModel()) {
                     //blöd dass diese schleife hier notwendig ist
                     //TODO: getDependentModels sollte was anderes zurückgeben
                     //gleiches problem wie bei getChildRows
                     foreach ($row->getModel()->getDependentModels() as $depName => $m) {
                         if (!$m instanceof Kwf_Model_Abstract) {
                             $m = Kwf_Model_Abstract::getInstance($m);
                         }
                         if ($m === $model) {
                             $rows = $row->getChildRows($depName);
                             //TODO effizienter machen, nicht über rows
                             foreach ($rows as $r) {
                                 $r->{$column} = $row->{$expr->getField()};
                                 $r->save();
                             }
                         }
                     }
                 }
             }
         }
     }
 }
コード例 #2
0
 public function dependentModelRowUpdated(Kwf_Model_Row_Abstract $row, $action)
 {
     parent::dependentModelRowUpdated($row, $action);
     $this->getProxyModel()->dependentModelRowUpdated($row, $action);
 }