array( 'link' => array('customer_id' => 'id'), ), ); } public static function scopes() { return array( 'active' => function($q) { return $q->andWhere('@.`status` = ' . Customer::STATUS_ACTIVE); }, ); } }