Browse Source

Added Sort::hasAttribute().

tags/2.0.0-beta
Qiang Xue 11 years ago
parent
commit
5d9c23c67b
  1. 10
      framework/yii/data/Sort.php
  2. 4
      framework/yii/db/ColumnSchema.php
  3. 3
      framework/yii/db/Schema.php
  4. 3
      framework/yii/db/TableSchema.php

10
framework/yii/data/Sort.php

@ -358,4 +358,14 @@ class Sort extends Object
} }
return implode($this->separators[0], $sorts); return implode($this->separators[0], $sorts);
} }
/**
* Returns a value indicating whether the sort definition supports sorting by the named attribute.
* @param string $name the attribute name
* @return boolean whether the sort definition supports sorting by the named attribute.
*/
public function hasAttribute($name)
{
return isset($this->attributes[$name]);
}
} }

4
framework/yii/db/ColumnSchema.php

@ -7,13 +7,15 @@
namespace yii\db; namespace yii\db;
use yii\base\Object;
/** /**
* ColumnSchema class describes the metadata of a column in a database table. * ColumnSchema class describes the metadata of a column in a database table.
* *
* @author Qiang Xue <qiang.xue@gmail.com> * @author Qiang Xue <qiang.xue@gmail.com>
* @since 2.0 * @since 2.0
*/ */
class ColumnSchema extends \yii\base\Component class ColumnSchema extends Object
{ {
/** /**
* @var string name of this column (without quotes). * @var string name of this column (without quotes).

3
framework/yii/db/Schema.php

@ -8,6 +8,7 @@
namespace yii\db; namespace yii\db;
use Yii; use Yii;
use yii\base\Object;
use yii\base\NotSupportedException; use yii\base\NotSupportedException;
use yii\base\InvalidCallException; use yii\base\InvalidCallException;
use yii\caching\Cache; use yii\caching\Cache;
@ -25,7 +26,7 @@ use yii\caching\GroupDependency;
* @author Qiang Xue <qiang.xue@gmail.com> * @author Qiang Xue <qiang.xue@gmail.com>
* @since 2.0 * @since 2.0
*/ */
abstract class Schema extends \yii\base\Object abstract class Schema extends Object
{ {
/** /**
* The followings are the supported abstract column data types. * The followings are the supported abstract column data types.

3
framework/yii/db/TableSchema.php

@ -7,6 +7,7 @@
namespace yii\db; namespace yii\db;
use yii\base\Object;
use yii\base\InvalidParamException; use yii\base\InvalidParamException;
/** /**
@ -17,7 +18,7 @@ use yii\base\InvalidParamException;
* @author Qiang Xue <qiang.xue@gmail.com> * @author Qiang Xue <qiang.xue@gmail.com>
* @since 2.0 * @since 2.0
*/ */
class TableSchema extends \yii\base\Object class TableSchema extends Object
{ {
/** /**
* @var string name of the catalog (database) that this table belongs to. * @var string name of the catalog (database) that this table belongs to.

Loading…
Cancel
Save