Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
syncEnrollments
Project
Project
Details
Activity
Releases
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Yeray Santana Hualde
syncEnrollments
Commits
34165061
Commit
34165061
authored
Oct 07, 2012
by
Taylor Otwell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
increment version. refactor eloquent eager loading matching.
parent
1df8fa91
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
35 additions
and
24 deletions
+35
-24
artisan
artisan
+1
-1
belongs_to.php
laravel/database/eloquent/relationships/belongs_to.php
+5
-4
has_many.php
laravel/database/eloquent/relationships/has_many.php
+5
-4
has_many_and_belongs_to.php
...tabase/eloquent/relationships/has_many_and_belongs_to.php
+5
-4
has_one.php
laravel/database/eloquent/relationships/has_one.php
+5
-9
changes.md
laravel/documentation/changes.md
+12
-0
paths.php
paths.php
+1
-1
index.php
public/index.php
+1
-1
No files found.
artisan
View file @
34165061
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
* Laravel - A PHP Framework For Web Artisans
* Laravel - A PHP Framework For Web Artisans
*
*
* @package Laravel
* @package Laravel
* @version 3.2.1
0
* @version 3.2.1
1
* @author Taylor Otwell <taylorotwell@gmail.com>
* @author Taylor Otwell <taylorotwell@gmail.com>
* @link http://laravel.com
* @link http://laravel.com
*/
*/
...
...
laravel/database/eloquent/relationships/belongs_to.php
View file @
34165061
...
@@ -87,17 +87,18 @@ class Belongs_To extends Relationship {
...
@@ -87,17 +87,18 @@ class Belongs_To extends Relationship {
{
{
$foreign
=
$this
->
foreign_key
();
$foreign
=
$this
->
foreign_key
();
$parents_hash
=
array
();
$dictionary
=
array
();
foreach
(
$parents
as
$parent
)
foreach
(
$parents
as
$parent
)
{
{
$
parents_hash
[
$parent
->
get_key
()]
=
$parent
;
$
dictionary
[
$parent
->
get_key
()]
=
$parent
;
}
}
foreach
(
$children
as
$child
)
foreach
(
$children
as
$child
)
{
{
if
(
array_key_exists
(
$child
->
$foreign
,
$
parents_hash
))
if
(
array_key_exists
(
$child
->
$foreign
,
$
dictionary
))
{
{
$child
->
relationships
[
$relationship
]
=
$
parents_hash
[
$child
->
$foreign
];
$child
->
relationships
[
$relationship
]
=
$
dictionary
[
$child
->
$foreign
];
}
}
}
}
}
}
...
...
laravel/database/eloquent/relationships/has_many.php
View file @
34165061
...
@@ -91,17 +91,18 @@ class Has_Many extends Has_One_Or_Many {
...
@@ -91,17 +91,18 @@ class Has_Many extends Has_One_Or_Many {
{
{
$foreign
=
$this
->
foreign_key
();
$foreign
=
$this
->
foreign_key
();
$children_hash
=
array
();
$dictionary
=
array
();
foreach
(
$children
as
$child
)
foreach
(
$children
as
$child
)
{
{
$
children_hash
[
$child
->
$foreign
][]
=
$child
;
$
dictionary
[
$child
->
$foreign
][]
=
$child
;
}
}
foreach
(
$parents
as
$parent
)
foreach
(
$parents
as
$parent
)
{
{
if
(
array_key_exists
(
$
parent
->
get_key
(),
$children_hash
))
if
(
array_key_exists
(
$
key
=
$parent
->
get_key
(),
$dictionary
))
{
{
$parent
->
relationships
[
$relationship
]
=
$
children_hash
[
$parent
->
get_key
()
];
$parent
->
relationships
[
$relationship
]
=
$
dictionary
[
$key
];
}
}
}
}
}
}
...
...
laravel/database/eloquent/relationships/has_many_and_belongs_to.php
View file @
34165061
...
@@ -328,17 +328,18 @@ class Has_Many_And_Belongs_To extends Relationship {
...
@@ -328,17 +328,18 @@ class Has_Many_And_Belongs_To extends Relationship {
{
{
$foreign
=
$this
->
foreign_key
();
$foreign
=
$this
->
foreign_key
();
$children_hash
=
array
();
$dictionary
=
array
();
foreach
(
$children
as
$child
)
foreach
(
$children
as
$child
)
{
{
$
children_hash
[
$child
->
pivot
->
$foreign
][]
=
$child
;
$
dictionary
[
$child
->
pivot
->
$foreign
][]
=
$child
;
}
}
foreach
(
$parents
as
$parent
)
foreach
(
$parents
as
$parent
)
{
{
if
(
array_key_exists
(
$
parent
->
get_key
(),
$children_hash
))
if
(
array_key_exists
(
$
key
=
$parent
->
get_key
(),
$dictionary
))
{
{
$parent
->
relationships
[
$relationship
]
=
$
children_hash
[
$parent
->
get_key
()
];
$parent
->
relationships
[
$relationship
]
=
$
dictionary
[
$key
];
}
}
}
}
}
}
...
...
laravel/database/eloquent/relationships/has_one.php
View file @
34165061
...
@@ -38,22 +38,18 @@ class Has_One extends Has_One_Or_Many {
...
@@ -38,22 +38,18 @@ class Has_One extends Has_One_Or_Many {
{
{
$foreign
=
$this
->
foreign_key
();
$foreign
=
$this
->
foreign_key
();
$children_hash
=
array
();
$dictionary
=
array
();
foreach
(
$children
as
$child
)
foreach
(
$children
as
$child
)
{
{
if
(
array_key_exists
(
$child
->
$foreign
,
$children_hash
))
$dictionary
[
$child
->
$foreign
]
=
$child
;
{
continue
;
}
$children_hash
[
$child
->
$foreign
]
=
$child
;
}
}
foreach
(
$parents
as
$parent
)
foreach
(
$parents
as
$parent
)
{
{
if
(
array_key_exists
(
$
parent
->
get_key
(),
$children_hash
))
if
(
array_key_exists
(
$
key
=
$parent
->
get_key
(),
$dictionary
))
{
{
$parent
->
relationships
[
$relationship
]
=
$
children_hash
[
$parent
->
get_key
()
];
$parent
->
relationships
[
$relationship
]
=
$
dictionary
[
$key
];
}
}
}
}
}
}
...
...
laravel/documentation/changes.md
View file @
34165061
...
@@ -2,6 +2,8 @@
...
@@ -2,6 +2,8 @@
## Contents
## Contents
-
[
Laravel 3.2.11
](
#3.2.11
)
-
[
Upgrading From 3.2.10
](
#upgrade-3.2.11
)
-
[
Laravel 3.2.10
](
#3.2.10
)
-
[
Laravel 3.2.10
](
#3.2.10
)
-
[
Upgrading From 3.2.9
](
#upgrade-3.2.10
)
-
[
Upgrading From 3.2.9
](
#upgrade-3.2.10
)
-
[
Laravel 3.2.9
](
#3.2.9
)
-
[
Laravel 3.2.9
](
#3.2.9
)
...
@@ -45,6 +47,16 @@
...
@@ -45,6 +47,16 @@
-
[
Laravel 3.1
](
#3.1
)
-
[
Laravel 3.1
](
#3.1
)
-
[
Upgrading From 3.0
](
#upgrade-3.1
)
-
[
Upgrading From 3.0
](
#upgrade-3.1
)
<a
name=
"3.2.11"
></a>
## Laravel 3.2.11
-
Improve performance of Eloquent eager load matching.
<a
name=
"upgrade-3.2.11"
></a>
### Upgrading From 3.2.10
-
Replace the
**laravel**
folder.
<a
name=
"3.2.10"
></a>
<a
name=
"3.2.10"
></a>
## Laravel 3.2.10
## Laravel 3.2.10
...
...
paths.php
View file @
34165061
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
* Laravel - A PHP Framework For Web Artisans
* Laravel - A PHP Framework For Web Artisans
*
*
* @package Laravel
* @package Laravel
* @version 3.2.1
0
* @version 3.2.1
1
* @author Taylor Otwell <taylorotwell@gmail.com>
* @author Taylor Otwell <taylorotwell@gmail.com>
* @link http://laravel.com
* @link http://laravel.com
*/
*/
...
...
public/index.php
View file @
34165061
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
* Laravel - A PHP Framework For Web Artisans
* Laravel - A PHP Framework For Web Artisans
*
*
* @package Laravel
* @package Laravel
* @version 3.2.1
0
* @version 3.2.1
1
* @author Taylor Otwell <taylorotwell@gmail.com>
* @author Taylor Otwell <taylorotwell@gmail.com>
* @link http://laravel.com
* @link http://laravel.com
*/
*/
...
...
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