public function __construct($config = array())
 {
     if (!isset($this->_default['content'])) {
         $this->_default['content'] = '<p>' . Kwc_Abstract::LOREM_IPSUM . '</p>';
     }
     parent::__construct($config);
 }
Beispiel #2
0
 public function __construct(array $config = array())
 {
     parent::__construct($config);
     if (!empty($config['tpl'])) {
         $this->_mailTemplate = $config['tpl'];
     } else {
         if (!empty($config['componentClass'])) {
             $this->_mailTemplate = $config['componentClass'];
         }
     }
     if (!empty($config['masterTpl'])) {
         $this->_mailMasterTemplate = $config['masterTpl'];
     }
     if (!empty($config['mailerClass'])) {
         if (!is_instance_of($config['mailerClass'], 'Kwf_Mail')) {
             throw new Kwf_Exception("mailerClass must be instance of Kwf_Mail. '" . $config['mailerClass'] . "' given.");
         }
         $this->_mailerClass = $config['mailerClass'];
     }
     if (!empty($config['additionalStore'])) {
         if (is_string($config['additionalStore'])) {
             $config['additionalStore'] = new $config['additionalStore']();
         }
         $this->_additionalStore = $config['additionalStore'];
     }
     if (isset($config['spamFields'])) {
         if (!is_array($config['spamFields'])) {
             throw new Kwf_Exception("config 'spamFields' for '" . get_class($this) . "' must be of type 'array', you've given type '" . gettype($config['spamFields']) . "'");
         }
         $this->_spamFields = $config['spamFields'];
     }
 }
 public function __construct($config = array())
 {
     $this->_tableName = uniqid('dbtest_parent');
     $config['proxyModel'] = new Kwf_Model_Db(array('table' => $this->_tableName));
     $this->_dependentModels['Childs'] = 'Kwf_Model_DbWithConnection_ParentExprIf_ChildModel';
     parent::__construct($config);
 }
 public function __construct($config = array())
 {
     $this->_tableName = uniqid('dbtest_child');
     $config['table'] = $this->_tableName;
     $this->_referenceMap = array('Parent' => 'parent_id->Kwf_Model_DbWithConnection_ProxyReferences_ParentModel', 'Parent2' => 'parent2_id->Kwf_Model_DbWithConnection_ProxyReferences_Parent2Model');
     parent::__construct($config);
 }
 public function __construct($config = array())
 {
     if (!isset($config['componentClass'])) {
         throw new Kwf_Exception("componentClass is required for text-model");
     }
     $this->_componentClass = $config['componentClass'];
     $this->setFactoryConfig(array('type' => 'Kwc_Basic_Text_ChildComponentsModelFactory', 'id' => $this->_componentClass . '.childModel', 'componentClass' => $this->_componentClass));
     parent::__construct($config);
 }
 public function __construct($config = array())
 {
     if (!isset($config['componentClass'])) {
         throw new Kwf_Exception("componentClass is required for text-model");
     }
     if (!isset($this->_default['content'])) {
         $default = Kwc_Abstract::getSetting($config['componentClass'], 'defaultText');
         $config['default']['content'] = "<p>{$default}</p>";
     }
     $this->_componentClass = $config['componentClass'];
     parent::__construct($config);
     $this->setFactoryConfig(array('type' => 'Kwc_Basic_Text_ModelFactory', 'id' => $this->_componentClass . '.ownModel', 'componentClass' => $this->_componentClass));
 }