Gentics Portal.Node PHP API
 All Classes Namespaces Functions Variables Pages
Public Member Functions | Static Public Member Functions | List of all members
ApalinesNews Class Reference
Inheritance diagram for ApalinesNews:
APAActiveRecord

Public Member Functions

 tableName ()
 rules ()
 relations ()
 attributeLabels ()
 search ()
 deleteFiles ($with_build=false)
 beforeDelete ()

Static Public Member Functions

static model ($className=__CLASS__)

Additional Inherited Members

- Protected Member Functions inherited from APAActiveRecord
 beforeSave ()

Detailed Description

Definition at line 27 of file ApalinesNews.php.

Member Function Documentation

ApalinesNews::attributeLabels ( )
Returns
array customized attribute labels (name=>label)

Definition at line 81 of file ApalinesNews.php.

{
return array(
'id' => 'ID',
'title' => 'Title',
'ndate' => 'Ndate',
'channel' => 'Channel',
'docid' => 'Docid',
'background_news' => 'Background News',
'related_maindoc_id' => 'Related Maindoc',
'place' => 'Place',
'source' => 'Source',
'teaser' => 'Teaser',
'content' => 'Content',
'filename' => 'Filename',
'author' => 'Author',
'keywords' => 'Keywords',
'deleted' => 'Deleted',
'created' => 'Created',
'updated' => 'Updated',
'xml_filename' => 'XML filename',
'apa_id' => 'APA id'
);
}
ApalinesNews::beforeDelete ( )

Function removes background news before record is deleted

Reimplemented from APAActiveRecord.

Definition at line 172 of file ApalinesNews.php.

References deleteFiles().

{
$this->deleteFiles(true);
if (isset($this->bg_news)) {
foreach ($this->bg_news as $bg) {
$bg->delete();
}
}
}
ApalinesNews::deleteFiles (   $with_build = false)

Function removes files and files of background news

Definition at line 144 of file ApalinesNews.php.

Referenced by beforeDelete().

{
if (isset($this->bg_news)) {
foreach ($this->bg_news as $bg) {
if (isset($bg->multimedia)) {
foreach ($bg->multimedia as $mm) {
if ($with_build) {
$mm->delete();
} else {
$mm->deleteFiles();
}
}
}
}
}
if (isset($this->multimedia)) {
foreach ($this->multimedia as $mm) {
if ($with_build) {
$mm->delete();
} else {
$mm->deleteFiles();
}
}
}
}
static ApalinesNews::model (   $className = __CLASS__)
static

Returns the static model of the specified AR class.

Parameters
string$classNameactive record class name.
Returns
ApalinesNews the static model class

Definition at line 34 of file ApalinesNews.php.

Referenced by processAPACommand\actionIndex(), Channel\clearOld(), Channel\makeRelations(), Channel\processMeldung(), and Channel\processRemoval().

{
return parent::model($className);
}
ApalinesNews::relations ( )
Returns
array relational rules.

Definition at line 68 of file ApalinesNews.php.

{
// NOTE: you may need to adjust the relation name and the related
// class name for the relations automatically generated below.
return array(
'bg_news'=>array(self::HAS_MANY, 'ApalinesNews', 'related_maindoc_id'),
'multimedia'=>array(self::HAS_MANY, 'ApalinesMM', 'related_maindoc_id'),
);
}
ApalinesNews::rules ( )
Returns
array validation rules for model attributes.

Definition at line 50 of file ApalinesNews.php.

{
// NOTE: you should only define rules for those attributes that
// will receive user inputs.
return array(
array('ndate, background_news, related_maindoc_id, deleted, created, updated', 'numerical', 'integerOnly'=>true),
array('title, channel, docid, place, source, author, xml_filename, apa_id', 'length', 'max'=>255),
array('filename', 'length', 'max'=>64),
array('teaser, content, keywords', 'safe'),
// The following rule is used by search().
// Please remove those attributes that should not be searched.
array('id, title, ndate, channel, docid, background_news, related_maindoc_id, place, source, teaser, content, filename, author, keywords, deleted, created, updated, xml_filename', 'safe', 'on'=>'search'),
);
}
ApalinesNews::search ( )

Retrieves a list of models based on the current search/filter conditions.

Returns
CActiveDataProvider the data provider that can return the models based on the search/filter conditions.

Definition at line 110 of file ApalinesNews.php.

{
// Warning: Please modify the following code to remove attributes that
// should not be searched.
$criteria=new CDbCriteria;
$criteria->compare('id',$this->id);
$criteria->compare('title',$this->title,true);
$criteria->compare('ndate',$this->ndate);
$criteria->compare('channel',$this->channel,true);
$criteria->compare('docid',$this->docid,true);
$criteria->compare('background_news',$this->background_news);
$criteria->compare('related_maindoc_id',$this->related_maindoc_id);
$criteria->compare('place',$this->place,true);
$criteria->compare('source',$this->source,true);
$criteria->compare('teaser',$this->teaser,true);
$criteria->compare('content',$this->content,true);
$criteria->compare('filename',$this->filename,true);
$criteria->compare('author',$this->author,true);
$criteria->compare('keywords',$this->keywords,true);
$criteria->compare('deleted',$this->deleted);
$criteria->compare('created',$this->created);
$criteria->compare('updated',$this->updated);
$criteria->compare('xml_filename',$this->xml_filename, true);
$criteria->compare('apa_id',$this->apa_id, true);
return new CActiveDataProvider($this, array(
'criteria'=>$criteria,
));
}
ApalinesNews::tableName ( )
Returns
string the associated database table name

Definition at line 42 of file ApalinesNews.php.

{
return 'gportal_apalines_news';
}

The documentation for this class was generated from the following file: