示例#1
0
 /**
  * Declares the name of the Sphinx index associated with this AR class.
  * By default this method returns the class name as the index name by calling {@see \rock\helpers\Inflector::camel2id()}.
  * For example, 'Article' becomes 'article', and 'StockItem' becomes
  * 'stock_item'. You may override this method if the index is not named after this convention.
  * @return string the index name
  */
 public static function indexName()
 {
     return Inflector::camel2id(ObjectHelper::basename(get_called_class()), '_');
 }
示例#2
0
 /**
  * Declares the name of the database table associated with this AR class.
  * By default this method returns the class name as the table name by calling {@see \rock\helpers\Inflector::camel2id()}
  * with prefix {@see \rock\db\Connection::$tablePrefix}.
  * For example if {@see \rock\db\Connection::$tablePrefix} is 'tbl_', 'Customer' becomes 'tbl_customer',
  * and 'OrderItem' becomes 'tbl_order_item'. You may override this method
  * if the table is not named after this convention.
  *
  * @return string the table name
  */
 public static function tableName()
 {
     return '{{%' . Inflector::camel2id(ObjectHelper::basename(get_called_class()), '_') . '}}';
 }