Commit 5d9c23c6 by Qiang Xue

Added Sort::hasAttribute().

parent f2ceef4c
...@@ -358,4 +358,14 @@ class Sort extends Object ...@@ -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]);
}
} }
...@@ -7,13 +7,15 @@ ...@@ -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).
......
...@@ -8,6 +8,7 @@ ...@@ -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; ...@@ -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.
......
...@@ -7,6 +7,7 @@ ...@@ -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; ...@@ -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.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment