NAMESPACE: packages/actionMexample/Models

ProductcategoriesModel extends CActiveRecord

This is an example of a model which uses custom database table. Please refer to YII 1.1.19 documentation on how to work with ActiveRecord. To use this class in your main Model.php, you could do this for example: $categories = ProductcategoriesModel::model()->findAllByAttributes(array('app_id' => $this->app_id));

When defining custom database columns for your action, make sure to include app_id column, which should always be set with you app_id, which is available in your main model as $this->app_id. If record is user specific, include play_id column, and populate it within the main model using $this->playid. These columns should have relations set to ae_game (for app_id) and ae_play (for play_id) with a cascade on delete. This way when user or app is deleted, also the related records get cleaned up.

Example of creating a new record: $new_record = new ProductcategoriesModel(); $new_record->app_id = $this->app_id; $new_record->title = '{#my_category_title#}'; $new_record->insert();

public properties
public function tableName()
public static function model($className)


public function relations()