public function update()
 {
     parent::update();
     $select = new Kwf_Model_Select();
     $select->where(new Kwf_Model_Select_Expr_Or(array(new Kwf_Model_Select_Expr_Equals('dimension', 'customcrop'), new Kwf_Model_Select_Expr_Equals('dimension', 'custombestfit'))));
     $select->order('dimension', 'asc');
     $rows = Kwf_Model_Abstract::getInstance('Kwc_Abstract_Image_Model')->getRows($select);
     foreach ($rows as $row) {
         if ($row->dimension == 'customcrop') {
             $row->dimension = 'custom';
             $row->crop_x = null;
             $row->crop_y = null;
             $row->crop_width = null;
             $row->crop_heigth = null;
         } else {
             if ($row->dimension == 'custombestfit') {
                 $row->dimension = 'custom';
                 if ($row->imageExists()) {
                     $targetSize = array('width' => $row->width, 'height' => $row->height, 'cover' => false);
                     $outputSize = Kwf_Media_Image::calculateScaleDimensions($row->getParentRow('Image')->getFileSource(), $targetSize);
                     $row->width = $outputSize['width'];
                     $row->height = $outputSize['height'];
                     $row->crop_x = $outputSize['crop']['x'];
                     $row->crop_y = $outputSize['crop']['y'];
                     $row->crop_width = $outputSize['crop']['width'];
                     $row->crop_height = $outputSize['crop']['height'];
                 }
             }
         }
         $row->save();
     }
 }
 public function update()
 {
     $ret = parent::update();
     $mailRow = Kwf_Model_Abstract::getInstance('Kwc_Mail_Model')->createRow();
     if (!isset($mailRow->return_path)) {
         Kwf_Registry::get('db')->query("ALTER TABLE `kwc_mail` ADD `return_path` VARCHAR( 255 ) NOT NULL");
     }
     return $ret;
 }
 public function update()
 {
     parent::update();
     $db = Zend_Registry::get('db');
     $db->query("CREATE TABLE IF NOT EXISTS `kwc_basic_link_event` (\n  `component_id` varchar(255) NOT NULL,\n  `event_id` varchar(255) NOT NULL,\n  PRIMARY KEY  (`component_id`),\n  KEY `event_id` (`event_id`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8");
     $fieldModel = Kwf_Model_Abstract::getInstance('Kwf_Component_FieldModel');
     $rows = $fieldModel->getRows($fieldModel->select()->where(new Kwf_Model_Select_Expr_Like('data', '%event_id%')));
     $eventTagModel = Kwf_Model_Abstract::getInstance('Kwc_Basic_LinkTag_Event_Model');
     foreach ($rows as $row) {
         $eventTagModel->createRow(array('component_id' => $row->component_id, 'event_id' => $row->event_id))->save();
     }
 }
 public function update()
 {
     parent::update();
     $db = Zend_Registry::get('db');
     $r = $db->fetchOne("SHOW FIELDS FROM kwf_pages LIKE 'tags'");
     if ($r) {
         $db->query("ALTER TABLE kwf_pages DROP tags");
     }
     $r = $db->fetchOne("SHOW FIELDS FROM kwf_pages LIKE 'domain'");
     if ($r) {
         $db->query("ALTER TABLE kwf_pages DROP domain");
     }
 }
 public function postUpdate()
 {
     parent::postUpdate();
     $components = Kwf_Component_Data_Root::getInstance()->getComponentsByClass('Kwc_Advanced_Youtube_Component', array('ignoreVisible' => true));
     foreach ($components as $c) {
         $row = $c->getComponent()->getRow();
         if (!$row->size) {
             if (!$row->videoWidth || $row->videoWidth == '100%') {
                 $row->size = 'fullWidth';
             } else {
                 $row->size = 'custom';
                 $row->video_width = $row->videoWidth;
             }
             unset($row->videoWidth);
             $row->save();
         }
     }
 }
 public function update()
 {
     parent::update();
     $db = Zend_Registry::get('db');
     $db->query("CREATE TABLE IF NOT EXISTS `kwc_basic_link_blog_post` (\n  `component_id` varchar(255) NOT NULL,\n  `blog_post_id` varchar(255) NOT NULL,\n  PRIMARY KEY  (`component_id`),\n  KEY `blog_post_id` (`blog_post_id`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8");
 }
 public function update()
 {
     parent::update();
     $db = Zend_Registry::get('db');
     $db->query("ALTER TABLE `kwc_basic_link_intern` ADD INDEX ( `target` )");
 }
 public function update()
 {
     parent::update();
     Kwf_Registry::get('db')->query("UPDATE `kwc_shop_orders` SET payment='prePayment' WHERE payment='prepayment'");
 }
 public function __construct($uploadsPath)
 {
     $this->_uploadsPath = $uploadsPath;
     parent::__construct(null, null);
 }