Browse Source

doc fix.

tags/2.0.0-beta
Qiang Xue 11 years ago
parent
commit
73442fb12a
  1. 3
      extensions/elasticsearch/Connection.php
  2. 54
      extensions/elasticsearch/QueryBuilder.php
  3. 3
      extensions/sphinx/Connection.php
  4. 1
      framework/yii/base/Application.php
  5. 3
      framework/yii/base/Widget.php
  6. 13
      framework/yii/db/ActiveRecord.php
  7. 5
      framework/yii/log/EmailTarget.php
  8. 2
      framework/yii/mail/BaseMessage.php

3
extensions/elasticsearch/Connection.php

@ -15,6 +15,9 @@ use yii\helpers\Json;
/** /**
* elasticsearch Connection is used to connect to an elasticsearch cluster version 0.20 or higher * elasticsearch Connection is used to connect to an elasticsearch cluster version 0.20 or higher
* *
* @property string $driverName Name of the DB driver. This property is read-only.
* @property boolean $isActive Whether the DB connection is established. This property is read-only.
*
* @author Carsten Brandt <mail@cebe.cc> * @author Carsten Brandt <mail@cebe.cc>
* @since 2.0 * @since 2.0
*/ */

54
extensions/elasticsearch/QueryBuilder.php

@ -14,7 +14,6 @@ use yii\helpers\Json;
/** /**
* QueryBuilder builds an elasticsearch query based on the specification given as a [[Query]] object. * QueryBuilder builds an elasticsearch query based on the specification given as a [[Query]] object.
* *
*
* @author Carsten Brandt <mail@cebe.cc> * @author Carsten Brandt <mail@cebe.cc>
* @since 2.0 * @since 2.0
*/ */
@ -247,7 +246,7 @@ class QueryBuilder extends \yii\base\Object
} }
if (count($column) > 1) { if (count($column) > 1) {
return $this->buildCompositeInCondition($operator, $column, $values, $params); return $this->buildCompositeInCondition($operator, $column, $values);
} elseif (is_array($column)) { } elseif (is_array($column)) {
$column = reset($column); $column = reset($column);
} }
@ -289,61 +288,10 @@ class QueryBuilder extends \yii\base\Object
protected function buildCompositeInCondition($operator, $columns, $values) protected function buildCompositeInCondition($operator, $columns, $values)
{ {
throw new NotSupportedException('composite in is not supported by elasticsearch.'); throw new NotSupportedException('composite in is not supported by elasticsearch.');
$vss = array();
foreach ($values as $value) {
$vs = array();
foreach ($columns as $column) {
if (isset($value[$column])) {
$phName = self::PARAM_PREFIX . count($params);
$params[$phName] = $value[$column];
$vs[] = $phName;
} else {
$vs[] = 'NULL';
}
}
$vss[] = '(' . implode(', ', $vs) . ')';
}
foreach ($columns as $i => $column) {
if (strpos($column, '(') === false) {
$columns[$i] = $this->db->quoteColumnName($column);
}
}
return '(' . implode(', ', $columns) . ") $operator (" . implode(', ', $vss) . ')';
} }
private function buildLikeCondition($operator, $operands) private function buildLikeCondition($operator, $operands)
{ {
throw new NotSupportedException('like conditions is not supported by elasticsearch.'); throw new NotSupportedException('like conditions is not supported by elasticsearch.');
if (!isset($operands[0], $operands[1])) {
throw new Exception("Operator '$operator' requires two operands.");
}
list($column, $values) = $operands;
$values = (array)$values;
if (empty($values)) {
return $operator === 'LIKE' || $operator === 'OR LIKE' ? '0==1' : '';
}
if ($operator === 'LIKE' || $operator === 'NOT LIKE') {
$andor = ' AND ';
} else {
$andor = ' OR ';
$operator = $operator === 'OR LIKE' ? 'LIKE' : 'NOT LIKE';
}
if (strpos($column, '(') === false) {
$column = $this->db->quoteColumnName($column);
}
$parts = array();
foreach ($values as $value) {
$phName = self::PARAM_PREFIX . count($params);
$params[$phName] = $value;
$parts[] = "$column $operator $phName";
}
return implode($andor, $parts);
} }
} }

3
extensions/sphinx/Connection.php

@ -52,9 +52,6 @@ use yii\base\NotSupportedException;
* *
* @property string $lastInsertID The row ID of the last row inserted, or the last value retrieved from the * @property string $lastInsertID The row ID of the last row inserted, or the last value retrieved from the
* sequence object. This property is read-only. * sequence object. This property is read-only.
* @property Schema $schema The schema information for this Sphinx connection. This property is read-only.
* @property \yii\sphinx\QueryBuilder $queryBuilder The query builder for this Sphinx connection. This property is
* read-only.
* *
* @author Paul Klimov <klimov.paul@gmail.com> * @author Paul Klimov <klimov.paul@gmail.com>
* @since 2.0 * @since 2.0

1
framework/yii/base/Application.php

@ -23,6 +23,7 @@ use yii\web\HttpException;
* @property \yii\base\Formatter $formatter The formatter application component. This property is read-only. * @property \yii\base\Formatter $formatter The formatter application component. This property is read-only.
* @property \yii\i18n\I18N $i18n The internationalization component. This property is read-only. * @property \yii\i18n\I18N $i18n The internationalization component. This property is read-only.
* @property \yii\log\Logger $log The log component. This property is read-only. * @property \yii\log\Logger $log The log component. This property is read-only.
* @property \yii\mail\MailerInterface $mail The mailer interface. This property is read-only.
* @property \yii\web\Request|\yii\console\Request $request The request component. This property is read-only. * @property \yii\web\Request|\yii\console\Request $request The request component. This property is read-only.
* @property string $runtimePath The directory that stores runtime files. Defaults to the "runtime" * @property string $runtimePath The directory that stores runtime files. Defaults to the "runtime"
* subdirectory under [[basePath]]. * subdirectory under [[basePath]].

3
framework/yii/base/Widget.php

@ -14,7 +14,8 @@ use ReflectionClass;
* Widget is the base class for widgets. * Widget is the base class for widgets.
* *
* @property string $id ID of the widget. * @property string $id ID of the widget.
* @property View $view The view object that can be used to render views or view files. * @property \yii\web\View $view The view object that can be used to render views or view files. Note that the
* type of this property differs in getter and setter. See [[getView()]] and [[setView()]] for details.
* @property string $viewPath The directory containing the view files for this widget. This property is * @property string $viewPath The directory containing the view files for this widget. This property is
* read-only. * read-only.
* *

13
framework/yii/db/ActiveRecord.php

@ -22,19 +22,6 @@ use yii\helpers\Inflector;
* *
* @include @yii/db/ActiveRecord.md * @include @yii/db/ActiveRecord.md
* *
* @property array $dirtyAttributes The changed attribute values (name-value pairs). This property is
* read-only.
* @property boolean $isNewRecord Whether the record is new and should be inserted when calling [[save()]].
* @property array $oldAttributes The old attribute values (name-value pairs).
* @property mixed $oldPrimaryKey The old primary key value. An array (column name => column value) is
* returned if the primary key is composite. A string is returned otherwise (null will be returned if the key
* value is null). This property is read-only.
* @property array $populatedRelations An array of relation data indexed by relation names. This property is
* read-only.
* @property mixed $primaryKey The primary key value. An array (column name => column value) is returned if
* the primary key is composite. A string is returned otherwise (null will be returned if the key value is null).
* This property is read-only.
*
* @author Qiang Xue <qiang.xue@gmail.com> * @author Qiang Xue <qiang.xue@gmail.com>
* @author Carsten Brandt <mail@cebe.cc> * @author Carsten Brandt <mail@cebe.cc>
* @since 2.0 * @since 2.0

5
framework/yii/log/EmailTarget.php

@ -14,9 +14,8 @@ use yii\mail\MailerInterface;
/** /**
* EmailTarget sends selected log messages to the specified email addresses. * EmailTarget sends selected log messages to the specified email addresses.
* *
* The target email addresses may be specified via [[emails]] property. * You may configure the email to be sent by setting the [[message]] property, through which
* Optionally, you may set the email [[subject]], [[sentFrom]] address and * you can set the target email addresses, subject, etc.
* additional [[headers]].
* *
* @author Qiang Xue <qiang.xue@gmail.com> * @author Qiang Xue <qiang.xue@gmail.com>
* @since 2.0 * @since 2.0

2
framework/yii/mail/BaseMessage.php

@ -18,8 +18,6 @@ use Yii;
* *
* @see BaseMailer * @see BaseMailer
* *
* @property MailerInterface $mailer The mailer component. This property is read-only.
*
* @author Paul Klimov <klimov.paul@gmail.com> * @author Paul Klimov <klimov.paul@gmail.com>
* @since 2.0 * @since 2.0
*/ */

Loading…
Cancel
Save