Commit Graph

372 Commits

Author SHA1 Message Date
Taylor Otwell
fc9b0e1636 Merge pull request #1201 from JoostK/fix-1
Fixed a problem with `Eloquent::get_dirty`
2012-09-25 18:37:09 -07:00
RK
f148f6211c Fixing the array_get misspelling. 2012-09-24 10:35:07 -04:00
RK
258169ea00 [#1261] get_key now pulls from $original instead
This is in reference to issue #1261, where Model->get_key() returns
the key from the $attributes instead of from the $original property.
This breaks the functionality of a model with a primary key that may
change, as the SQL generated will be something like:

UPDATE `model` SET `key` = 'new-key' WHERE `key` = 'new-key';

Which won't update the model in the database.
2012-09-24 09:58:20 -04:00
Patrick Romowicz
966e8462c9 Update laravel/database/connection.php 2012-09-17 21:49:17 +03:00
Patrick Romowicz
5f9a26bae3 Undefined namespace Grammars 2012-09-17 21:42:47 +03:00
Patrick Romowicz
034c63b39d add use Closure; 2012-09-17 21:34:13 +03:00
arisk
752161cae3 Setting the exception code in the constructor 2012-09-14 16:47:55 +07:00
arisk
e541cf9ebd Added PDO error code 2012-09-14 11:16:46 +07:00
JoostK
5f99c81035 Fixed a problem whith Eloquent::get_dirty
When you had a synched Eloquent model (e.g. without changed values) but
one of those values is `null`, then that value would be considered as
dirty. `Eloquent::changed` returns false, but the value is present in
`Eloquent::get_dirty`.

This fix makes sure that a `null` value in `$attributes` is only
present in `get_dirty` when it wasn't at all *set* in `$original`.
2012-09-09 20:52:33 +02:00
kapil verma
2773e317ea Removed a Useless if conditional from bind method 2012-09-04 02:54:21 +05:30
kapil verma
55ad4e9a6d Added a method to fluently set belongs-to relation
This method spun off from a discussion in IRC. What this enables is this:

$user->comments()->insert($comment_data)->article()->bind($article->id)
2012-09-04 02:40:28 +05:30
Callum McIntyre
6b73974505 Added new touch function to eloquent, updates timestamps and immediately saves
Signed-off-by: Callum McIntyre <mcintyre1994@gmail.com>
2012-09-03 21:44:16 +01:00
Taylor Otwell
b061b9b21c Merge pull request #1150 from franzliedke/patch-40
Get rid of duplicate code for DROP TABLE in schema grammars.
2012-09-01 18:05:29 -07:00
Taylor Otwell
852b10e836 Merge pull request #1143 from franzliedke/patch-38
Fix insert() method for related models.
2012-09-01 18:02:41 -07:00
Taylor Otwell
db48fa4140 Merge pull request #1121 from mcintyre94/minor/unprotect-eloquent-timestamps
Minor/unprotect eloquent timestamps
2012-09-01 17:52:53 -07:00
Taylor Otwell
4db08087f7 Merge pull request #1089 from kbanman/fix-query-lists
Fix Query::lists() for empty resultsets
2012-09-01 17:41:49 -07:00
Taylor Otwell
4a60981582 Merge pull request #1084 from joecwallace/pivot_fix
Fixing a bug with saving data to pivot table
2012-09-01 17:40:14 -07:00
Taylor Otwell
46f68ab78c Merge pull request #813 from anaxamaxan/patch-3
Allow Model instance or id for first argument in Has_Many_And_Belongs_To::attach()
2012-09-01 16:52:36 -07:00
Taylor Otwell
c7679bafe0 Merge pull request #770 from abigwonderful/develop
added dblib option to sqlsrv connector class /sam fitz (abigwonderful)
2012-09-01 16:45:50 -07:00
Taylor Otwell
f34063c517 Fix bug in Eloquent to_array method. 2012-08-29 14:44:16 -05:00
Franz Liedke
e11d13ae31 Get rid of duplicate code for DROP TABLE in schema grammars. 2012-08-27 15:09:11 +02:00
Franz Liedke
e46f07d436 Fix method signature and return values of insert() method. 2012-08-27 13:46:32 +03:00
Franz Liedke
aa341357ec Fix insert() method for related models. 2012-08-26 01:10:31 +03:00
Callum McIntyre
f8fdcd894a Changed timestamp function in eloquent/model.php to public 2012-08-19 15:15:42 +01:00
Taylor Otwell
1203473469 revert eloquent back to 3.2.3 2012-08-17 09:18:16 -05:00
Taylor Otwell
9718d5cd0d fix nested queries. 2012-08-17 09:02:32 -05:00
Dayle Rees
4b8ba99211 Merge pull request #1043 from tobsn/patch-10
type boolean is tinyint(1)
2012-08-12 12:43:15 -07:00
Kelly Banman
e3a000af41 Fix Query::lists() for empty resultsets 2012-08-11 15:52:58 -07:00
Joe Wallace
d31f89d42f Fixing a bug with saving data to pivot table 2012-08-09 22:10:49 -05:00
Sergii Grebeniuk
690e8572aa phpdoc fixes 2012-08-03 18:17:48 +03:00
Tobsn
5716b4da40 type boolean is tinyint(1)
switched from default "tinyint" which creates a tinyint(4) to the
standard mysql boolean type "tinyint(1)"
2012-08-02 00:54:30 +02:00
Dayle Rees
30175c2a52 fixing merge issues for comment tweaks 2012-07-31 16:55:02 +01:00
Tobsn
89d8c5bb0d Returning results with SHOW queries
reference to #991
2012-07-31 10:04:53 +02:00
Dayle Rees
2c6ed23b45 fixing merge issues 2012-07-27 13:52:15 +01:00
Pascal Borreli
8a34aa5077 Fixed typos 2012-07-27 11:29:59 +00:00
Dayle Rees
3b09f99f9e Merge pull request #989 from dprvig/develop
Fixed various typos throughout laravel folder.
2012-07-27 03:54:40 -07:00
Taylor Otwell
5c3ede74d9 Merge pull request #946 from franzliedke/patch-23
Fix eager loading constraints
2012-07-24 06:09:41 -07:00
Josh Miller
0ea30993d4 Fixed various typos throughout laravel folder.
Signed-off-by: Josh Miller <josh@joshmmiller.com>
2012-07-21 20:18:55 -04:00
Taylor Otwell
38234c61dd Merge pull request #480 from cviebrock/schema-rename
Schema::rename('oldtable','newtable') support
2012-07-19 13:42:34 -07:00
Taylor Otwell
cd9a745cb5 Merge pull request #972 from franzliedke/patch-28
[Schema] Allow boolean default values
2012-07-19 13:35:18 -07:00
Rack Lin
54f4cb2644 Added support PostgreSQL schema setting, if schema has been specified.
Signed-off-by: Rack Lin <racklin@gmail.com>
2012-07-19 12:55:23 +08:00
Franz Liedke
61364c553d Make sure default values in schema columns are always non-empty (especially booleans). 2012-07-17 23:47:05 +02:00
Shawn McCool
dc6bcf0793 use global paginator alias in the query class 2012-07-16 10:05:07 +02:00
Franz Liedke
78920c5d27 Move automatic relationship parsing to Eloquent's query class. 2012-07-12 22:32:43 +02:00
Franz Liedke
8c2a4fba14 The Eloquent model includes can now be taken directly from the model when assembling the query. 2012-07-12 23:20:17 +03:00
Franz Liedke
71f8e4acc0 Fix a bug introduced in pull request #799 that caused eager loading constraints to stop working. 2012-07-12 23:16:22 +03:00
Chris Berthe
b325e954e3 Merge remote-tracking branch 'upstream/develop' into develop 2012-07-12 11:15:43 -04:00
Taylor Otwell
1879e6575a tweak eloquent model change method to not check types. 2012-07-10 08:02:08 -05:00
Taylor Otwell
845023fc80 Merge pull request #847 from tobsn/patch-1
NOT NULL order issue fixed!
2012-07-06 18:12:11 -07:00
Taylor Otwell
8198dc23f3 Merge pull request #874 from franzliedke/patch-16
[Eloquent] Constraining eager loads only allows WHERE clauses
2012-07-06 17:51:27 -07:00
Taylor Otwell
90447e7183 Merge pull request #892 from jasonlewis/bug/database/select
Fixes #818, allows Query select to just be an Expression.
2012-07-06 17:14:20 -07:00
Taylor Otwell
e6ff7ba336 Merge pull request #901 from franzliedke/patch-18
Ignore NULL values when determining whether a model object is dirty
2012-07-06 17:07:58 -07:00
Taylor Otwell
a9d27ba79c Merge pull request #902 from JesseObrien/feature/eloquent-update-timestamp
Feature/eloquent update timestamp
2012-07-06 17:07:34 -07:00
Jesse O'Brien
1be274caa6 Change update function so it uses timestamp like save
Calling update() on an eloquent model has no way of overriding
the timestamp that should be set if $timestamps is set on the
model. This changes that so it uses the timestamp() function
which is an easy way to over ride the type of timestamps used.
2012-07-04 15:46:12 -04:00
Franz Liedke
f2ccc688fe Ignore NULL values when determining whether a model object is dirty. 2012-07-04 21:44:11 +03:00
Chris Berthe
3b6191ec16 Merge remote-tracking branch 'upstream/develop' into develop 2012-07-01 12:33:03 -04:00
Jason Lewis
52f76b9d66 Fixes #818, wraps in an array instead of type casting.
Signed-off-by: Jason Lewis <jason.lewis1991@gmail.com>
2012-07-01 22:51:42 +09:30
Franz Liedke
a87bb86999 Fix a bug with Eloquent model classes and isset() when eager loading a relationship returns an empty result set. 2012-06-29 20:56:32 +03:00
Taylor Otwell
14e9488cf9 Speed up eager loading of many to many. 2012-06-28 15:19:20 -05:00
Franz Liedke
39df69fdc1 Allow more than just WHERE clauses on eager load constraints. 2012-06-28 18:33:45 +03:00
Chris Berthe
f3d756476b Merge remote-tracking branch 'upstream/develop' into develop 2012-06-25 13:11:54 -04:00
Tobsn
31abcd599b unique typo 2012-06-22 08:54:10 -07:00
Tobsn
0b9b102dc7 NOT NULL order issue fixed!
thanks @crynobone !!!
2012-06-22 08:50:09 -07:00
Dayle Rees
8d13bf9c5a removing unsigned from mysql grammer due to bug
Signed-off-by: Dayle Rees <thepunkfan@gmail.com>
2012-06-22 16:25:50 +01:00
Taylor Otwell
7af0304fe8 Merge branch 'master' into develop 2012-06-21 11:38:50 -05:00
Taylor Otwell
1b062499dd Merge pull request #774 from franzliedke/patch-8
Avoid unnecessary end() in Table::command() function
2012-06-20 09:59:50 -07:00
Taylor Otwell
3fcb3aac6c Merge pull request #775 from franzliedke/patch-9
Foreign key creation ignores database prefix
2012-06-20 09:58:38 -07:00
Taylor Otwell
a203a12da4 Merge pull request #799 from Jelle-S/develop
Eloquent - simplify eager loading
2012-06-20 09:57:59 -07:00
SonicHedgehog
ec4556321d Fixed typo 2012-06-20 13:01:52 +03:00
Chris Berthe
17e75a9719 Merge remote-tracking branch 'upstream/develop' into develop 2012-06-18 12:38:59 -04:00
Tobias Orterer
e0d491cb15 Added UNSIGNED to mysql grammar inrementer()
Added UNSIGNED to the mysql grammar file because auto increment fields
only run upwards, it's a waste of space to provide negative values by
the default SIGNED state of INT.
2012-06-16 19:46:50 -07:00
Koen Schmeets
aeeb010e0a Fixing reference issue in relationship matching 2012-06-16 17:52:07 +02:00
anaxamaxan
19a3e9dc2b Allow Model instance an id for first argument in Has_Many_And_Belongs_To::attach() and same for ::detach(). Also a typo fix for the docblock on attach(). 2012-06-13 16:23:28 -07:00
Chris Berthe
fafaf724b0 Grammar/Vocabulary fixes
Signed-off-by: Chris Berthe <chrisberthe@gmail.com>
2012-06-13 11:19:20 -04:00
Jelle Sebreghts
ac8bd0829e Fix for https://github.com/laravel/laravel/issues/789 2012-06-11 20:00:46 +02:00
Franz Liedke
7ead1796d0 Apply prefix to foreign key's "on" attribute, too. 2012-06-06 12:33:50 +03:00
Franz Liedke
605be704ff Avoid unnecessary end() in Table::column() function. 2012-06-06 12:23:00 +03:00
Franz Liedke
8fc80c47d9 Avoid unnecessary end() in Table::command() function. 2012-06-06 12:20:30 +03:00
Samuel Fitz
db351fedf0 added dblib option to sqlsrv connector class /sam fitz (abigwonderful)
simple conditional added to look for dsn type. if set and is dblib,
syntax for PDO connection adjusted slightly to allow for mac connection
to mssql server (utilizing freetds)
2012-06-05 13:31:21 -06:00
Taylor Otwell
ba6590d7b1 cleaning up code. 2012-06-03 17:44:53 -05:00
Taylor Otwell
f608157ffc Merge pull request #732 from franzliedke/patch-4
Add a last_query() function to Database connection class.
2012-06-03 15:43:44 -07:00
Taylor Otwell
d9c0dc0c35 Merge branch 'develop' of github.com:laravel/laravel into develop 2012-06-03 17:37:05 -05:00
Taylor Otwell
1ac911f05d Merge branch 'master' of github.com:laravel/laravel into develop 2012-06-03 17:36:16 -05:00
AndrewBNZ
c8466f5766 Fixed typo from previous fix, should be $command->columns not $command->$columns. 2012-06-03 23:51:38 +12:00
Jason Lewis
6d5239bf30 Missed a semi-colon.
Signed-off-by: Jason Lewis <jason.lewis1991@gmail.com>
2012-06-03 19:47:44 +09:30
Jason Lewis
b4db0f1b36 Small change moving array to a variable.
Signed-off-by: Jason Lewis <jason.lewis1991@gmail.com>
2012-06-03 19:45:49 +09:30
Jason Lewis
ab2fcb84ef Possible fix for issue #378.
Signed-off-by: Jason Lewis <jason.lewis1991@gmail.com>
2012-06-03 19:23:35 +09:30
Taylor Otwell
691d68ba54 improve / fix postgres support. 2012-05-30 14:23:27 -05:00
Franz Liedke
98b9898003 Add a last_query() function to Database connection class. 2012-05-30 18:37:55 +03:00
AndrewBNZ
b4b9c1f442 Fixes Laravel issue #727 - updated sqlserver grammar file to fix error in primary key function. 2012-05-30 18:42:22 +12:00
Colin Viebrock
ef5ab30ca2 Fix ... thanks Vespakoen! 2012-05-26 20:51:35 -05:00
Loic Sharma
4ea27c9daf Fixed minor spelling mistakes 2012-05-17 23:03:42 -05:00
Taylor Otwell
135b6d5132 Merge pull request #664 from franzliedke/patch-3
Remove more unneeded Closure references
2012-05-11 12:18:15 -07:00
Andrew Ellis
8e12e7a819 where_nested no longer breaks on closures that don't actually set anything 2012-05-11 13:11:02 -06:00
Taylor Otwell
b097b6c682 Fix to_array() in eloquent model. 2012-05-11 13:22:04 -05:00
Franz Liedke
09cb38fc67 Fix PHPDoc referring to Closure class. 2012-05-11 12:23:25 +03:00
Andrew Ellis
100a59c9c4 added trim() for the sql statement 2012-05-03 11:16:32 -06:00
Taylor Otwell
295c3b80c2 add sqlite query driver. 2012-05-03 08:28:40 -05:00
Taylor Otwell
4822f847c2 pass delete method through eloquent query. 2012-05-03 08:20:33 -05:00
Taylor Otwell
b5f5927fa7 Fix bug with many-to-many relationships on non-default database connection. 2012-05-02 09:37:40 -05:00