protected function init() { parent::init(); $this->registerInternalProperty('instance', SwatDBClassMap::get('SiteInstance')); $this->table = 'MailingListCampaignSegment'; $this->id_field = 'integer:id'; }
protected function init() { parent::init(); $this->registerInternalProperty('instance', SwatDBClassMap::get('SiteInstance')); $this->table = 'NewsletterTemplate'; $this->id_field = 'integer:id'; }
protected function init() { parent::init(); $this->table = 'EvaluationReport'; $this->id_field = 'integer:id'; $this->registerInternalProperty('provider', SwatDBClassMap::get('CMEProvider')); $this->registerDateProperty('quarter'); $this->registerDateProperty('createdate'); }
protected function init() { parent::init(); $this->table = 'Block'; $this->registerDateProperty('createdate'); $this->registerInternalProperty('attachment', SwatDBClassMap::get('SiteAttachment')); $this->registerInternalProperty('image', SwatDBClassMap::get('SiteImage')); $this->registerInternalProperty('media', SwatDBClassMap::get('SiteMedia')); $this->id_field = 'integer:id'; }
/** * Deletes this object from the database */ protected function deleteInternal() { if ($this->instance === null) { parent::deleteInternal(); } if ($this->table === null || $this->id_field === null) { return; } $id_field = new SwatDBField($this->id_field, 'integer'); if (!property_exists($this, $id_field->name)) { return; } $id_ref = $id_field->name; $id = $this->{$id_ref}; $instance_id = $this->instance === null ? null : $this->instance->id; if ($id !== null) { $sql = sprintf('delete from %s where %s = %s and instance %s %s', $this->table, $id_field->name, $id, SwatDB::equalityOperator($instance_id), $this->db->quote($instance_id, 'integer')); SwatDB::exec($this->db, $sql); } }
/** * Saves this object to the database * * Only modified properties are updated. */ protected function saveInternal() { if ($this->id === null) { $this->shortname = $this->generateShortname($this->title); $this->createdate = new SwatDate(); $this->createdate->toUTC(); } parent::saveInternal(); }
protected function getSerializablePrivateProperties() { return array_merge(parent::getSerializablePrivateProperties(), array('visible_files', 'tags_cache')); }
/** * Deletes this object from the database */ protected function deleteInternal() { $filename = $this->getFilePath(); if ($this->image !== null) { $this->image->setFileBase($this->getFileBase()); $this->image->delete(); } parent::deleteInternal(); if (file_exists($filename)) { unlink($filename); } }
protected function init() { parent::init(); $this->table = 'PinholePhotoMetaDataBinding'; $this->registerInternalProperty('photo', SwatDBClassMap::get('PinholePhoto')); //$this->registerInternalProperty('metadata', // $this->class_map->resolveClass('PinholeMetaData')); }
protected function init() { parent::init(); $this->table = 'Newsletter'; $this->id_field = 'integer:id'; $this->registerInternalProperty('template', SwatDBClassMap::get('DeliveranceNewsletterTemplate')); $this->registerInternalProperty('campaign_segment', SwatDBClassMap::get('DeliveranceCampaignSegment')); $this->registerInternalProperty('instance', SwatDBClassMap::get('SiteInstance')); $this->registerDateProperty('send_date'); $this->registerDateProperty('createdate'); }