public function save($conn = null) { parent::save(); $OR = $this->getObject(); if (!is_null($this['Categories']->getValue())) { $OR->setCategories(implode('@', $this['Categories']->getValue())); } $BASE = sfConfig::get('sf_web_dir') . '/' . $this->WEB_IMATGE; if ($OR instanceof Activitats) { $I = $OR->getImatge(); if (!empty($I) && file_exists($BASE . $I)) { $img = new sfImage($BASE . $I, 'image/jpg'); $img->resize(150, 150); $nom = $OR->getActivitatid() . '.jpg'; $img->saveAs($BASE . $nom); if ($I != $nom) { unlink($BASE . $I); } $OR->setImatge($nom); } $P = $OR->getPdf(); if (!empty($P) && file_exists($BASE . $P)) { $nom = $OR->getActivitatid() . '.pdf'; rename($BASE . $P, $BASE . $nom); if ($I != $nom) { unlink($BASE . $P); } $OR->setPdf($nom); } } $OR->save(); }
public function save($conn = null) { parent::save($conn); $OI = $this->getObject(); $DR = $OI->getDataresolucio(); if ($OI->getEstat() == IncidenciesPeer::ESTAT_RESOLT && is_null($DR)) { $OI->setDataresolucio(date('Y-m-d', time())); } $OI->save(); }
public function save($conn = null) { $OPromocions = $this->getObject(); PromocionsPeer::gestionaOrdre($this->getValue('Ordre'), $OPromocions->getOrdre(), $this->getOption('IDS')); parent::save(); $nom = $OPromocions->getExtensio(); if (!empty($nom)) { $img = new sfImage($this->URL . $nom, 'image/jpg'); $img->resize(171, 63)->saveAs($this->URL . $nom); } }
public function save($conn = null) { $ONodes = $this->getObject(); NodesPeer::gestionaOrdre($this->getValue('Ordre'), $ONodes->getOrdre(), $this->getOption('IDS')); parent::save(); }