'integer', 'name' => 'string', 'email' => 'string', 'address' => 'string', 'status' => 'integer', ); } public function getOrders() { return $this->hasMany('Order', array('customer_id' => 'id'))->orderBy('id'); } public static function active($query) { $query->andWhere(array('status' => 1)); } }