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

Public Member Functions

 tableName ()
 rules ()
 relations ()
 getExistUser ()
 attributeLabels ()
 implementFromSession ()
 unsetExistFields ()
 search ()
 rules ()
 attributeLabels ()
 search ()
 tableName ()

Static Public Member Functions

static model ($className=__CLASS__)
static model ($className=__CLASS__)

Protected Member Functions

 afterFind ()
 beforeSave ()

Detailed Description

Definition at line 27 of file TmpUser.php.

Member Function Documentation

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

Reimplemented from TmpUserBasic.

Definition at line 17 of file TmpUser.php.

References model(), and WebCustModule\t().

{
$attributes = parent::model()->attributeLabels();
$attributes = CMap::mergeArray($attributes, array(
'memberNo' => ShoppingcartModule::t('MemberNo'),
'svnr' => ShoppingcartModule::t('SVNR'),
)
);
return $attributes;
}
TmpUser::attributeLabels ( )
Returns
array customized attribute labels (name=>label)

Reimplemented from TmpUserBasic.

Definition at line 176 of file TmpUser.php.

References WebCustModule\t().

{
return array(
'id' => ShoppingcartModule::t('ID'),
'salutation' => ShoppingcartModule::t('Salutation'),
'firstname' => ShoppingcartModule::t('First Name'),
'lastname' => ShoppingcartModule::t('Last Name'),
'company' => ShoppingcartModule::t('Company'),
'birthday' => ShoppingcartModule::t('Date Of Birth'),
'street' => ShoppingcartModule::t('Street'),
'zip_code' => ShoppingcartModule::t('Zip Code'),
'city' => ShoppingcartModule::t('City'),
'country' => ShoppingcartModule::t('Country'),
'telephone' => ShoppingcartModule::t('Telephone'),
'email' => ShoppingcartModule::t('Email'),
);
}
static TmpUser::model (   $className = __CLASS__)
static

Returns the static model of the specified AR class.

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

Reimplemented from TmpUserBasic.

Definition at line 34 of file TmpUser.php.

Referenced by attributeLabels(), model(), rules(), search(), and ShoppingcartTest\setUp().

{
return parent::model($className);
}
static TmpUser::model (   $className = __CLASS__)
static

Returns the static model of the specified AR class.

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

Reimplemented from TmpUserBasic.

Definition at line 37 of file TmpUser.php.

References model().

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

Reimplemented from TmpUserBasic.

Definition at line 154 of file TmpUser.php.

{
// NOTE: you may need to adjust the relation name and the related
// class name for the relations automatically generated below.
return array(
'order' => array(self::HAS_ONE, 'Order', 'user_id'),
);
}
TmpUser::rules ( )
protected function beforeSave()
{
    if(parent::beforeSave())
    {

Format dates based on the locale foreach($this->metadata->tableSchema->columns as $columnName => $column) { if ($column->dbType == 'date') { $this->$columnName = date('Y-m-d', CDateTimeParser::parse($this->$columnName, Yii::app()->locale->getDateFormat('short'))); } elseif ($column->dbType == 'datetime') { $this->$columnName = date('Y-m-d H:i:s', CDateTimeParser::parse($this->$columnName, Yii::app()->locale->getDateTimeFormat('short'))); } } return true; } else return false; } protected function afterFind() { Format dates based on the locale foreach($this->metadata->tableSchema->columns as $columnName => $column) { if (!strlen($this->$columnName)) continue;

if ($column->dbType == 'date') { $this->$columnName = Yii::app()->dateFormatter->formatDateTime( CDateTimeParser::parse( $this->$columnName, 'yyyy-MM-dd' ), 'short',null ); } elseif ($column->dbType == 'datetime' || $column->dbType == 'timestamp') { $this->$columnName = Yii::app()->dateFormatter->formatDateTime( CDateTimeParser::parse( $this->$columnName, 'yyyy-MM-dd hh:mm:ss' ), 'short','short' ); } } return parent::afterFind(); }

Returns
array validation rules for model attributes.

Reimplemented from TmpUserBasic.

Definition at line 5 of file TmpUser.php.

References model().

{
$rules = parent::model()->rules();
$rules = CMap::mergeArray($rules, array(
array('svnr, memberNo', 'length', 'max'=>255),
array('svnr, memberNo', 'safe', 'on'=>'search'),
array('memberNo, svnr','filter', 'filter'=>array($obj=new CHtmlPurifier(),'purify')),
)
);
return $rules;
}
TmpUser::rules ( )
protected function beforeSave()
{
    if(parent::beforeSave())
    {

Format dates based on the locale foreach($this->metadata->tableSchema->columns as $columnName => $column) { if ($column->dbType == 'date') { $this->$columnName = date('Y-m-d', CDateTimeParser::parse($this->$columnName, Yii::app()->locale->getDateFormat('short'))); } elseif ($column->dbType == 'datetime') { $this->$columnName = date('Y-m-d H:i:s', CDateTimeParser::parse($this->$columnName, Yii::app()->locale->getDateTimeFormat('short'))); } } return true; } else return false; } protected function afterFind() { Format dates based on the locale foreach($this->metadata->tableSchema->columns as $columnName => $column) { if (!strlen($this->$columnName)) continue;

if ($column->dbType == 'date') { $this->$columnName = Yii::app()->dateFormatter->formatDateTime( CDateTimeParser::parse( $this->$columnName, 'yyyy-MM-dd' ), 'short',null ); } elseif ($column->dbType == 'datetime' || $column->dbType == 'timestamp') { $this->$columnName = Yii::app()->dateFormatter->formatDateTime( CDateTimeParser::parse( $this->$columnName, 'yyyy-MM-dd hh:mm:ss' ), 'short','short' ); } } return parent::afterFind(); }

Returns
array validation rules for model attributes.

Reimplemented from TmpUserBasic.

Definition at line 131 of file TmpUser.php.

{
// NOTE: you should only define rules for those attributes that
// will receive user inputs.
$dateFormat = Yii::app()->locale->getDateFormat();
$dateFormat = ($dateFormat == 'MMM d, y')?'MMM d, yyyy':$dateFormat;
return array(
array('salutation, firstname, lastname, street, zip_code, city, country, email', 'required'),
array('salutation, firstname, lastname, company, street, zip_code, city, country, telephone, email', 'length', 'max'=>255),
array('email','email'),
array('birthday','date','format' => $dateFormat), //'dd.MM.yyyy'
array('birthday', 'safe'),
// The following rule is used by search().
// Please remove those attributes that should not be searched.
array('id, salutation, firstname, lastname, company, birthday, street, zip_code, city, country, telephone, email', 'safe', 'on'=>'search'),
array('salutation, firstname, lastname, street, zip_code, city, country, email, birthday, telephone, company','filter', 'filter'=>array($obj=new CHtmlPurifier(),'purify')),
);
}
TmpUser::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.

Reimplemented from TmpUserBasic.

Definition at line 28 of file TmpUser.php.

References model().

{
$searchProvider = parent::model()->search();
$searchProvider->criteria->compare('memberNo',$this->memberNo,true);
$searchProvider->criteria->compare('svnr',$this->svnr,true);
return $searchProvider;
}
TmpUser::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.

Reimplemented from TmpUserBasic.

Definition at line 237 of file TmpUser.php.

{
// Warning: Please modify the following code to remove attributes that
// should not be searched.
$criteria=new CDbCriteria;
$criteria->compare('id',$this->id,true);
$criteria->compare('salutation',$this->salutation,true);
$criteria->compare('first_name',$this->first_name,true);
$criteria->compare('last_name',$this->last_name,true);
$criteria->compare('company',$this->company,true);
$criteria->compare('date_of_birth',$this->date_of_birth,true);
$criteria->compare('street',$this->street,true);
$criteria->compare('zip_code',$this->zip_code,true);
$criteria->compare('city',$this->city,true);
$criteria->compare('svnr',$this->svnr,true);
$criteria->compare('memberNo',$this->memberNo,true);
$criteria->compare('country',$this->country,true);
$criteria->compare('telephone',$this->telephone,true);
$criteria->compare('email',$this->email,true);
return new CActiveDataProvider($this, array(
'criteria'=>$criteria,
));
}
TmpUser::tableName ( )
Returns
string the associated database table name

Reimplemented from TmpUserBasic.

Definition at line 42 of file TmpUser.php.

{
return '{{tmp_user}}';
}
TmpUser::tableName ( )
Returns
string the associated database table name

Reimplemented from TmpUserBasic.

Definition at line 42 of file TmpUser.php.

{
return '{{tmp_user}}';
}

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