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
f97f73a8
Commit
f97f73a8
authored
Apr 01, 2012
by
Taylor Otwell
Browse files
Options
Browse Files
Download
Plain Diff
fixing merge conflicts.
parents
8d169166
363b7c54
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
49 additions
and
11 deletions
+49
-11
artisan
artisan
+1
-1
changes.md
changes.md
+25
-0
model.php
laravel/database/eloquent/model.php
+13
-0
has_many_and_belongs_to.php
...tabase/eloquent/relationships/has_many_and_belongs_to.php
+1
-3
grammar.php
laravel/database/query/grammars/grammar.php
+7
-5
paths.php
paths.php
+1
-1
index.php
public/index.php
+1
-1
No files found.
artisan
View file @
f97f73a8
...
...
@@ -3,7 +3,7 @@
* Laravel - A PHP Framework For Web Artisans
*
* @package Laravel
* @version 3.1.
2
* @version 3.1.
4
* @author Taylor Otwell <taylorotwell@gmail.com>
* @link http://laravel.com
*/
...
...
changes.md
View file @
f97f73a8
...
...
@@ -4,6 +4,10 @@
-
[
Laravel 3.2
](
#3.2
)
-
[
Upgrading From 3.1
](
#upgrade-3.2
)
-
[
Laravel 3.1.4
](
#3.1.4
)
-
[
Upgrading From 3.1.3
](
#upgrade-3.1.4
)
-
[
Laravel 3.1.3
](
#3.1.3
)
-
[
Upgrading From 3.1.2
](
#uprade-3.1.3
)
-
[
Laravel 3.1.2
](
#3.1.2
)
-
[
Upgrading From 3.1.1
](
#upgrade-3.1.2
)
-
[
Laravel 3.1.1
](
#3.1.1
)
...
...
@@ -26,6 +30,27 @@
-
Replace the
**laravel**
folder.
-
Add new
**vendors**
folder.
<a
name=
"3.1.4"
></a>
## Laravel 3.1.4
-
Fixes Response header casing bug.
-
Fixes SQL "where in" (...) short-cut bug.
<a
name=
"upgrade-3.1.4"
></a>
## Upgrading From 3.1.3
-
Replace the
**laravel**
folder.
<a
name=
"3.1.3"
></a>
## Laravel 3.1.3
-
Fixes
**delete**
method in Eloquent models.
<a
name=
"upgrade-3.1.3"
></a>
## Upgrade From 3.1.2
-
Replace the
**laravel**
folder.
<a
name=
"3.1.2"
></a>
## Laravel 3.1.2
...
...
laravel/database/eloquent/model.php
View file @
f97f73a8
...
...
@@ -385,6 +385,19 @@ abstract class Model {
return
$result
;
}
/**
* Delete the model from the database.
*
* @return int
*/
public
function
delete
()
{
if
(
$this
->
exists
)
{
return
$this
->
query
()
->
where
(
static
::
$key
,
'='
,
$this
->
get_key
())
->
delete
();
}
}
/**
* Set the update and creation timestamps on the model.
*
...
...
laravel/database/eloquent/relationships/has_many_and_belongs_to.php
View file @
f97f73a8
...
...
@@ -170,9 +170,7 @@ class Has_Many_And_Belongs_To extends Relationship {
*/
public
function
delete
()
{
$id
=
$this
->
base
->
get_key
();
return
$this
->
joining_table
()
->
where
(
$this
->
foreign_key
(),
'='
,
$id
)
->
delete
();
return
$this
->
pivot
()
->
delete
();
}
/**
...
...
laravel/database/query/grammars/grammar.php
View file @
f97f73a8
...
...
@@ -397,22 +397,24 @@ class Grammar extends \Laravel\Database\Grammar {
* @param array $bindings
* @return string
*/
public
function
shortcut
(
$sql
,
$bindings
)
public
function
shortcut
(
$sql
,
&
$bindings
)
{
// Laravel provides an easy short-cut notation for writing raw WHERE IN
// statements. If (...) is in the query, it will be replaced with the
// correct number of parameters based on the bindings.
// correct number of parameters based on the
query
bindings.
if
(
strpos
(
$sql
,
'(...)'
)
!==
false
)
{
for
(
$i
=
0
;
$i
<
count
(
$bindings
);
$i
++
)
{
// If the binding is an array, we can just assume it's used to
//
fill a "where in" condition, so we will just replace the
//
next place-holder in the query with the constraint
.
// If the binding is an array, we can just assume it's used to
fill a
//
where in condition, so we'll just replace the next place-holder
//
in the query with the constraint and splice the bindings
.
if
(
is_array
(
$bindings
[
$i
]))
{
$parameters
=
$this
->
parameterize
(
$bindings
[
$i
]);
array_splice
(
$bindings
,
$i
,
1
,
$bindings
[
$i
]);
$sql
=
preg_replace
(
'~\(\.\.\.\)~'
,
"(
{
$parameters
}
)"
,
$sql
,
1
);
}
}
...
...
paths.php
View file @
f97f73a8
...
...
@@ -3,7 +3,7 @@
* Laravel - A PHP Framework For Web Artisans
*
* @package Laravel
* @version 3.1.
2
* @version 3.1.
4
* @author Taylor Otwell <taylorotwell@gmail.com>
* @link http://laravel.com
*/
...
...
public/index.php
View file @
f97f73a8
...
...
@@ -3,7 +3,7 @@
* Laravel - A PHP Framework For Web Artisans
*
* @package Laravel
* @version 3.1.
2
* @version 3.1.
4
* @author Taylor Otwell <taylorotwell@gmail.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