Exemplo n.º 1
0
 public function createRow(array $data = array())
 {
     $row = parent::createRow($data);
     if (!is_instance_of($this->_mailerClass, 'Kwf_Mail')) {
         throw new Kwf_Exception("mailerClass must be instance of 'Kwf_Mail'. '" . $this->_mailerClass . "' given.");
     }
     if (empty($this->_mailTemplate)) {
         throw new Kwf_Exception("mail template not set for class '" . get_class($this) . "' in construct-config");
     }
     if (!is_string($this->_mailTemplate)) {
         throw new Kwf_Exception("mail template must be of type 'string' but type '" . gettype($this->_mailTemplate) . "' has been set");
     }
     $row->setTemplate($this->_mailTemplate);
     $row->setMailerClass($this->_mailerClass);
     $row->setSpamFields($this->_spamFields);
     if ($this->_mailMasterTemplate) {
         $row->setMasterTemplate($this->_mailMasterTemplate);
     }
     return $row;
 }
 public function update()
 {
     // daten von kwc_columns in kwc_composite_list kopieren
     $columnsModel = new Kwf_Model_Db_Proxy(array('table' => 'kwc_columns'));
     $listModel = new Kwf_Model_Db_Proxy(array('table' => 'kwc_composite_list', 'siblingModels' => array(new Kwf_Model_Field(array('fieldName' => 'data')))));
     foreach ($columnsModel->getRows() as $colRow) {
         $listRow = $listModel->createRow();
         $listRow->component_id = $colRow->component_id;
         $listRow->pos = $colRow->pos;
         $listRow->visible = 1;
         $listRow->width = $colRow->width;
         $listRow->save();
         // ersetzungen für master
         $action = new Kwf_Update_Action_Component_ConvertComponentIds(array('search' => $colRow->component_id . '-' . $colRow->id, 'replace' => $listRow->component_id . '-' . $listRow->id));
         $action->checkSettings();
         $action->update();
         // ersetzungen für trl
         $action = new Kwf_Update_Action_Component_ConvertComponentIds(array('search' => $colRow->component_id . '-' . $colRow->id, 'replace' => $listRow->component_id . '-' . $listRow->id, 'pattern' => 'root-%\\_' . $colRow->component_id . '-' . $colRow->id . '%'));
         $action->checkSettings();
         $action->update();
     }
 }