Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yii2
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Rotua Panjaitan
yii2
Commits
1acdbb74
Commit
1acdbb74
authored
Nov 13, 2013
by
Carsten Brandt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
moved indexBy() trait -> interface + removed findWith from interface
parent
51faa62e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
31 deletions
+19
-31
ActiveQueryInterface.php
framework/yii/ar/ActiveQueryInterface.php
+19
-0
ActiveQueryTrait.php
framework/yii/ar/ActiveQueryTrait.php
+0
-22
ActiveRelationInterface.php
framework/yii/ar/ActiveRelationInterface.php
+0
-9
No files found.
framework/yii/ar/ActiveQueryInterface.php
View file @
1acdbb74
...
...
@@ -27,6 +27,25 @@ interface ActiveQueryInterface extends QueryInterface
public
function
asArray
(
$value
=
true
);
/**
* Sets the [[indexBy]] property.
* @param string|callable $column the name of the column by which the query results should be indexed by.
* This can also be a callable (e.g. anonymous function) that returns the index value based on the given
* row or model data. The signature of the callable should be:
*
* ~~~
* // $model is an AR instance when `asArray` is false,
* // or an array of column values when `asArray` is true.
* function ($model)
* {
* // return the index value corresponding to $model
* }
* ~~~
*
* @return static the query object itself
*/
public
function
indexBy
(
$column
);
/**
* Specifies the relations with which this query should be performed.
*
* The parameters to this method can be either one or multiple strings, or a single array
...
...
framework/yii/ar/ActiveQueryTrait.php
View file @
1acdbb74
...
...
@@ -103,28 +103,6 @@ trait ActiveQueryTrait
}
/**
* Sets the [[indexBy]] property.
* @param string|callable $column the name of the column by which the query results should be indexed by.
* This can also be a callable (e.g. anonymous function) that returns the index value based on the given
* row or model data. The signature of the callable should be:
*
* ~~~
* // $model is an AR instance when `asArray` is false,
* // or an array of column values when `asArray` is true.
* function ($model)
* {
* // return the index value corresponding to $model
* }
* ~~~
*
* @return static the query object itself
*/
public
function
indexBy
(
$column
)
{
return
parent
::
indexBy
(
$column
);
}
/**
* Converts found rows into model instances
* @param array $rows
* @return array|ActiveRecord[]
...
...
framework/yii/ar/ActiveRelationInterface.php
View file @
1acdbb74
...
...
@@ -26,13 +26,4 @@ interface ActiveRelationInterface extends ActiveQueryInterface
* @return static the relation object itself.
*/
public
function
via
(
$relationName
,
$callable
=
null
);
/**
* Finds the related records and populates them into the primary models.
* This method is internally used by [[ActiveQuery]]. Do not call it directly.
* @param string $name the relation name
* @param array $primaryModels primary models
* @return array the related models
*/
public
function
findWith
(
$name
,
&
$primaryModels
);
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment