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