Skip to content
Permalink
Browse files

Fix API doc errors for Database/

  • Loading branch information...
markstory committed Jul 8, 2014
1 parent 2d71a81 commit 061b5d69d84d7fcaf7a8b2a454ec638964b712d0
@@ -79,7 +79,7 @@ public function __construct($config = []) {
* Returns correct connection resource or object that is internally used
* If first argument is passed,
*
* @param null|\PDO instance $connection
* @param null|\PDO $connection The connection object
* @return void
*/
public abstract function connection($connection = null);
@@ -94,7 +94,7 @@ public function __construct($config = []) {
/**
* Prepares a sql statement to be executed
*
* @param string|\Cake\Database\Query $query
* @param string|\Cake\Database\Query $query The query to convert into a statement.
* @return \Cake\Database\StatementInterface
*/
public abstract function prepare($query);
@@ -132,7 +132,7 @@ public function supportsSavePoints() {
/**
* Returns a value in a safe representation to be used in a query string
*
* @param mixed $value
* @param mixed $value The value to quote.
* @param string $type Type to be used for determining kind of quoting to perform
* @return string
*/
@@ -175,7 +175,7 @@ public function supportsQuoting() {
* Quotes a database identifier (a column name, table name, etc..) to
* be used safely in queries without the risk of using reserved words
*
* @param string $identifier
* @param string $identifier The identifier expression to quote.
* @return string
*/
public abstract function quoteIdentifier($identifier);
@@ -52,7 +52,7 @@ protected function _connect(array $config) {
* If first argument is passed, it will set internal conenction object or
* result to the value passed
*
* @param null|\PDO instance $connection The PDO connection instance.
* @param null|\PDO $connection The PDO connection instance.
* @return mixed connection object used internally
*/
public function connection($connection = null) {
@@ -68,7 +68,7 @@ public function __construct($field, $value, $type, $conjunction) {
/**
* Sets the field name
*
* @param string $field
* @param string $field The field to compare with.
* @return void
*/
public function field($field) {
@@ -78,7 +78,7 @@ public function field($field) {
/**
* Sets the value
*
* @param mixed $value
* @param mixed $value The value to compare
* @return void
*/
public function value($value) {
@@ -123,7 +123,7 @@ public function sql(ValueBinder $generator) {
* Returns a template and an placeholder for the value after registering it
* with the placeholder $generator
*
* @param ValueBinder $generator
* @param \Cake\Database\ValueBinder $generator The value binder to use.
* @return array First position containing the template and the second a placeholder
*/
protected function _stringExpression($generator) {
@@ -141,9 +141,9 @@ protected function _stringExpression($generator) {
/**
* Registers a value in the placeholder generator and returns the generated placeholder
*
* @param mixed $value
* @param ValueBinder $generator
* @param string $type
* @param mixed $value The value to bind
* @param \Cake\Database\ValueBinder $generator The value binder to use
* @param string $type The type of $value
* @return string generated placeholder
*/
protected function _bindValue($value, $generator, $type) {
@@ -157,7 +157,7 @@ protected function _bindValue($value, $generator, $type) {
* $generator and separated by `,`
*
* @param array|\Traversable $value the value to flatten
* @param ValueBinder $generator
* @param \Cake\Database\ValueBinder $generator The value binder to use
* @param string|array $type the type to cast values to
* @return string
*/
@@ -67,7 +67,7 @@ public function __construct($name, $params = [], $types = []) {
* Sets the name of the SQL function to be invoke in this expression,
* if no value is passed it will return current name
*
* @param string $name
* @param string $name The name of the function
* @return string
*/
public function name($name = null) {
@@ -37,13 +37,13 @@ class IdentifierExpression implements ExpressionInterface {
* @param string $identifier The identifier this expression represents
*/
public function __construct($identifier) {
$this->setIdentifier($identifier);
$this->_identifier = $identifier;
}
/**
* Sets the identifier this expression represents
*
* @param string $identifier
* @param string $identifier The identifier
* @return void
*/
public function setIdentifier($identifier) {
@@ -73,7 +73,7 @@ public function sql(ValueBinder $generator) {
* This method is a no-op, this is a leaf type of expression,
* hence there is nothing to traverse
*
* @param callable $callable
* @param callable $callable The callable to traverse with.
* @return void
*/
public function traverse(callable $callable) {
@@ -27,8 +27,8 @@ class OrderByExpression extends QueryExpression {
/**
* Constructor
*
* @param array $conditions
* @param array $types
* @param array $conditions The sort columns
* @param array $types The types for each column.
* @param string $conjunction The glue used to join conditions together.
*/
public function __construct($conditions = [], $types = [], $conjunction = '') {
@@ -60,7 +60,6 @@ class QueryExpression implements ExpressionInterface, Countable {
* passed in $conditions.
* @param string $conjunction the glue that will join all the string conditions at this
* level of the expression tree. For example "AND", "OR", "XOR"...
* @param TypeMap $typeMap contains default and call specific type mapping
* @see QueryExpression::add() for more details on $conditions and $types
*/
public function __construct($conditions = [], $types = [], $conjunction = 'AND') {
@@ -373,7 +372,7 @@ public function sql(ValueBinder $generator) {
*
* Callback function receives as only argument an instance of a QueryExpression
*
* @param callable $callable
* @param callable $callable The callable to apply to all sub-expressions.
* @return void
*/
public function traverse(callable $callable) {
@@ -396,7 +395,7 @@ public function traverse(callable $callable) {
* passed by reference, this will enable you to change the key under which the
* modified part is stored.
*
* @param callable $callable
* @param callable $callable The callable to apply to each part.
* @return QueryExpression
*/
public function iterateParts(callable $callable) {
@@ -511,7 +510,7 @@ protected function _parseCondition($field, $value) {
* to each value in the first argument.
*
* @param string $field database field to be used to bind values
* @param array $values
* @param array $values The values to bind
* @param string $type the type to be used to bind the values
* @return array
*/
@@ -69,7 +69,7 @@ public function sql(ValueBinder $generator) {
* Returns a string with the values as placeholders in a string to be used
* for the SQL version of this expression
*
* @param \Cake\Database\ValueBinder $generator
* @param \Cake\Database\ValueBinder $generator The value binder to convert expressions with.
* @return string
*/
protected function _stringifyValues($generator) {
@@ -114,9 +114,9 @@ protected function _stringifyValues($generator) {
* Registers a value in the placeholder generator and returns the generated
* placeholder
*
* @param \Cake\Database\ValueBinder $generator
* @param mixed $value
* @param string $type
* @param \Cake\Database\ValueBinder $generator The value binder
* @param mixed $value The value to bind
* @param string $type The type to use
* @return string generated placeholder
*/
protected function _bindValue($generator, $value, $type) {
@@ -131,7 +131,7 @@ protected function _bindValue($generator, $value, $type) {
*
* Callback function receives as its only argument an instance of an ExpressoinInterface
*
* @param callable $callable
* @param callable $callable The callable to apply to sub-expressions
* @return void
*/
public function traverse(callable $callable) {
@@ -161,8 +161,8 @@ public function traverse(callable $callable) {
* Conditionally executes the callback for the passed value if
* it is an ExpressionInterface
*
* @param mixed $value
* @param callable $callable
* @param mixed $value The value to traverse
* @param callable $callable The callable to use when traversing
* @return void
*/
protected function _traverseValue($value, $callable) {
@@ -57,7 +57,7 @@ class ValuesExpression implements ExpressionInterface {
* Constructor
*
* @param array $columns The list of columns that are going to be part of the values.
* @param TypeMap $types A dictionary of column -> type names
* @param \Cake\Database\TypeMap $typeMap A dictionary of column -> type names
*/
public function __construct(array $columns, $typeMap) {
$this->_columns = $columns;
@@ -123,7 +123,7 @@ public function values($values = null) {
* to insert records in the table. If no params are passed, then it returns
* the currently stored query
*
* @param \Cake\Database\Query $query
* @param \Cake\Database\Query $query The query to set/get
* @return \Cake\Database\Query
*/
public function query(Query $query = null) {
@@ -33,7 +33,7 @@ public function sql(ValueBinder $generator);
* passing as first parameter the instance of the expression currently
* being iterated.
*
* @param callable $visitor
* @param callable $visitor The callable to apply to all nodes.
* @return void
*/
public function traverse(callable $visitor);
@@ -203,7 +203,7 @@ protected function _quoteComparison(Comparison $expression) {
/**
* Quotes identifiers in "order by" expression objects
*
* @param \Cake\Database\Expression\OrderByExpression $expression
* @param \Cake\Database\Expression\OrderByExpression $expression The expression to quote.
* @return void
*/
protected function _quoteOrderBy(OrderByExpression $expression) {
@@ -43,6 +43,7 @@ class LoggingStatement extends StatementDecorator {
*
* @param array $params list of values to be bound to query
* @return bool true on success, false otherwise
* @throws \Exception Re-throws any exception raised during query execution.
*/
public function execute($params = null) {
$t = microtime(true);
@@ -65,7 +66,7 @@ public function execute($params = null) {
* Copies the logging data to the passed LoggedQuery and sends it
* to the logging system.
*
* @param \Cake\Database\Log\LoggedQuery $query
* @param \Cake\Database\Log\LoggedQuery $query The query to log.
* @param array $params list of values to be bound to query
* @param float $startTime the microtime when the query was executed
* @return void
@@ -1421,7 +1421,7 @@ protected function _decorateStatement($statement) {
* Helper function used to build conditions by composing QueryExpression objects.
*
* @param string $part Name of the query part to append the new part to
* @param string|array|ExpressionInterface|callback $append
* @param string|array|ExpressionInterface|callback $append Expression or builder function to append.
* @param string $conjunction type of conjunction to be used to operate part
* @param array $types associative array of type names used to bind values to query
* @return void
@@ -96,9 +96,9 @@ public function compile(Query $query, ValueBinder $generator) {
* Returns a callable object that can be used to compile a SQL string representation
* of this query.
*
* @param string $sql initial sql string to append to
* @param string &$sql initial sql string to append to
* @param \Cake\Database\Query $query The query that is being compiled
* @param \Cake\Database\ValueBinder The placeholder and value binder object
* @param \Cake\Database\ValueBinder $generator The placeholder and value binder object
* @return \Closure
*/
protected function _sqlCompiler(&$sql, $query, $generator) {
@@ -253,7 +253,7 @@ protected function _buildUnionPart($parts, $query, $generator) {
/**
* Builds the SQL fragment for INSERT INTO.
*
* @param array $parts
* @param array $parts The insert parts.
* @param \Cake\Database\Query $query The query that is being compiled
* @param \Cake\Database\ValueBinder $generator the placeholder generator to be used in expressions
* @return string SQL fragment.
@@ -267,7 +267,7 @@ protected function _buildInsertPart($parts, $query, $generator) {
/**
* Builds the SQL fragment for INSERT INTO.
*
* @param array $parts
* @param array $parts The values parts.
* @param \Cake\Database\Query $query The query that is being compiled
* @param \Cake\Database\ValueBinder $generator the placeholder generator to be used in expressions
* @return string SQL fragment.
@@ -68,7 +68,7 @@ protected function _foreignOnClause($on) {
/**
* Convert string on clauses to the abstract ones.
*
* @param string $clause
* @param string $clause The on clause to convert.
* @return string|null
*/
protected function _convertOnClause($clause) {
@@ -52,7 +52,7 @@ class Collection {
/**
* Constructor.
*
* @param \Cake\Database\Connection $connection
* @param \Cake\Database\Connection $connection The connection instance.
*/
public function __construct(Connection $connection) {
$this->_connection = $connection;
@@ -23,7 +23,7 @@ trait SqlDialectTrait {
* Quotes a database identifier (a column name, table name, etc..) to
* be used safely in queries without the risk of using reserved words
*
* @param string $identifier
* @param string $identifier The identifier to quote.
* @return string
*/
public function quoteIdentifier($identifier) {
@@ -40,7 +40,7 @@ class TypeMap {
/**
* Creates an instance with the given defaults
*
* @param array $defaults
* @param array $defaults The defaults to use.
*/
public function __construct(array $defaults = []) {
$this->defaults($defaults);
@@ -57,7 +57,7 @@ public function __construct(array $defaults = []) {
* ## Example
*
* {{{
* $query->defaults(['created' => 'datetime', 'is_visible' => 'boolean']);
* $query->defaults(['created' => 'datetime', 'is_visible' => 'boolean']);
* }}}
*
* @param array $defaults associative array where keys are field names and values
@@ -80,10 +80,10 @@ public function defaults(array $defaults = null) {
* ## Example
*
* {{{
* $query->types(['created' => 'time']);
* $query->types(['created' => 'time']);
* }}}
*
* @param array $defaults associative array where keys are field names and values
* @param array $types associative array where keys are field names and values
* are the correspondent type.
* @return this|array
*/
@@ -100,7 +100,8 @@ public function types(array $types = null) {
* the column type will be looked for inside the default mapping. If neither exist,
* null will be returned.
*
* @var null|string
* @param string $column The type for a given column
* @return null|string
*/
public function type($column) {
if (isset($this->_types[$column])) {
@@ -112,4 +113,4 @@ public function type($column) {
return null;
}
}
}
@@ -47,7 +47,7 @@ public function typeMap($typeMap = null) {
/**
* Allows setting default types when chaining query
*
* @param array $types
* @param array $types The array of types to set.
* @return this|array
*/
public function defaultTypes(array $types = null) {
@@ -58,4 +58,4 @@ public function defaultTypes(array $types = null) {
return $this;
}
}
}
Oops, something went wrong.

0 comments on commit 061b5d6

Please sign in to comment.
You can’t perform that action at this time.