Gentics Portal.Node PHP API
 All Classes Namespaces Functions Variables Pages
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
ApalinesFile Class Reference

Public Member Functions

 tableName ()
 rules ()
 relations ()
 attributeLabels ()
 search ()
 beforeDelete ()

Static Public Member Functions

static model ($className=__CLASS__)

Public Attributes

const THUMBNAIL = 0
const ORIGINAL = 1
const HIRES = 2

Detailed Description

Definition at line 15 of file ApalinesFile.php.

Member Function Documentation

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

Definition at line 70 of file ApalinesFile.php.

{
return array(
'id' => 'ID',
'href' => 'Href',
'size' => 'Size',
'width' => 'Width',
'height' => 'Height',
'format' => 'Format',
'parent_id' => 'Parent',
);
}
ApalinesFile::beforeDelete ( )

Function removes multimedia files before record is deleted

Definition at line 109 of file ApalinesFile.php.

{
$channel = Channel::$instance;
$file = $this->href;
if (isset($channel)) {
if (file_exists($channel->makeImagesPath($file))) {
unlink($channel->makeImagesPath($file));
Yii::log("{$file} done delete image", 'info');
} elseif(file_exists($channel->makeVideosPath($file))) {
Yii::log("{$file} done delete video", 'info');
unlink($channel->makeVideosPath($file));
}
}
}
static ApalinesFile::model (   $className = __CLASS__)
static

Returns the static model of the specified AR class.

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

Definition at line 25 of file ApalinesFile.php.

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

Definition at line 59 of file ApalinesFile.php.

{
// NOTE: you may need to adjust the relation name and the related
// class name for the relations automatically generated below.
return array(
);
}
ApalinesFile::rules ( )
Returns
array validation rules for model attributes.

Definition at line 41 of file ApalinesFile.php.

{
// NOTE: you should only define rules for those attributes that
// will receive user inputs.
return array(
array('parent_id', 'required'),
array('size, width, height, parent_id', 'numerical', 'integerOnly'=>true),
array('href', 'length' , 'max'=>255),
array('format', 'length' , 'max'=>5),
// The following rule is used by search().
// Please remove those attributes that should not be searched.
array('id, href, size, width, height, format, parent_id', 'safe', 'on'=>'search'),
);
}
ApalinesFile::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 87 of file ApalinesFile.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('href',$this->href,true);
$criteria->compare('size',$this->size);
$criteria->compare('width',$this->width);
$criteria->compare('height',$this->height);
$criteria->compare('format',$this->format);
$criteria->compare('parent_id',$this->parent_id);
return new CActiveDataProvider($this, array(
'criteria'=>$criteria,
));
}
ApalinesFile::tableName ( )
Returns
string the associated database table name

Definition at line 33 of file ApalinesFile.php.

{
return 'gportal_apalines_file';
}

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