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
TmpUserBasic Class Reference
Inheritance diagram for TmpUserBasic:
TmpUser

Public Member Functions

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

Static Public Member Functions

static model ($className=__CLASS__)

Protected Member Functions

 afterFind ()
 beforeSave ()

Detailed Description

Definition at line 29 of file TmpUserBasic.php.

Member Function Documentation

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

Reimplemented in TmpUser, and TmpUser.

Definition at line 177 of file TmpUserBasic.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 TmpUserBasic::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 in TmpUser, and TmpUser.

Definition at line 36 of file TmpUserBasic.php.

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

Reimplemented in TmpUser.

Definition at line 155 of file TmpUserBasic.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'),
);
}
TmpUserBasic::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 in TmpUser, and TmpUser.

Definition at line 132 of file TmpUserBasic.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')),
);
}
TmpUserBasic::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 in TmpUser, and TmpUser.

Definition at line 238 of file TmpUserBasic.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,
));
}
TmpUserBasic::tableName ( )
Returns
string the associated database table name

Reimplemented in TmpUser, and TmpUser.

Definition at line 43 of file TmpUserBasic.php.

{
return '{{tmp_user}}';
}

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