init() public method

Called from {@link __construct()} as final step of object instantiation.
public init ( ) : void
return void
Example #1
0
 function init()
 {
     parent::init();
     // NB! если свойство должно быть не в data, то прописывать его индивидуально!
     $this->_data = array('ItemCountPerPage' => 10, 'isPaginator' => true, 'isReturnPaginator' => false, 'generalWhere' => '', 'conditionWhere' => false, 'isStoredRows' => false);
     if ($this->_alias === null) {
         $this->imgs['folder'] = $this->_name;
     } else {
         $this->imgs['folder'] = $this->_alias;
     }
     #$conf = Zend_Registry::get('conf');
     #d($conf->logger->sql);
 }
Example #2
0
 public function init()
 {
     parent::init();
 }
Example #3
0
 public function init()
 {
     parent::init();
     if (isset($this->_multilang_field) || isset($this->_multilang_type)) {
         $this->_current_lang = $reg = Zend_Registry::isRegistered('Zkernel_Multilang') ? Zend_Registry::get('Zkernel_Multilang') : '';
         if ($reg) {
             $changed = false;
             $cols = $this->info('metadata');
             switch ($this->_multilang_type) {
                 case 1:
                     if (!array_key_exists('lang', $cols)) {
                         $changed = true;
                         $this->getAdapter()->query('ALTER TABLE `' . $this->_name . '` ADD `lang` int(11)');
                         $this->getAdapter()->query('ALTER TABLE `' . $this->_name . '` ADD INDEX `i_lang` (`lang`)');
                     }
                     break;
                 default:
                     $m = new Default_Model_Lang();
                     $ids = implode('|', $reg->_ids);
                     $ml = implode('|', $this->_multilang_field);
                     foreach ($this->_multilang_field as $k => $el) {
                         if (!array_key_exists('ml_' . $el . '_' . $reg->id, $cols)) {
                             $changed = true;
                             $this->getAdapter()->query('ALTER TABLE `' . $this->_name . '` ADD `ml_' . $el . '_' . $reg->id . '` ' . $cols[$el]['DATA_TYPE'] . ($cols[$el]['LENGTH'] ? '(' . $cols[$el]['LENGTH'] . ')' : '') . ($cols[$el]['DEFAULT'] ? ' DEFAULT ' . $cols[$el]['DEFAULT'] : ''));
                         }
                     }
                     /*foreach ($cols as $k => $el) {
                     			if (preg_match('/^ml\_'.$el.'\_(\d+)$/i', $k) && !preg_match('/^ml\_('.implode('|', $this->_multilang_field).')\_('.implode('|', $ids).')+$/i')) {
                     				$changed = true;
                     				$this->getAdapter()->query('ALTER TABLE `'.$this->_name.'` DROP `'.$k.'`');
                     			}
                     		}*/
                     break;
             }
             if ($changed) {
                 $cache = $this->getMetadataCache();
                 if ($cache) {
                     $cache->clean();
                 }
             }
         }
     }
 }
Example #4
0
 public function init()
 {
     $this->_iniConfig = new Zend_Config_Ini(APPLICATION_PATH . '/configs/application.ini', APPLICATION_ENV);
     parent::init();
 }
Example #5
0
 public function init()
 {
     parent::init();
     $this->logger = Zend_Registry::get('logger')->ensureStream('system');
 }
Example #6
0
 public function init()
 {
     return parent::init();
 }