Commit Graph

340 Commits

Author SHA1 Message Date
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
Taylor Otwell
7e33ec5f34 Allow the registration of custom database drivers. 2012-04-30 22:40:18 -05:00
Taylor Otwell
9057c60a5f Merge pull request #584 from bencorlett/develop
Adding having() support to the Fluent query builder.
2012-04-26 18:26:19 -07:00
Taylor Otwell
86fce099b3 Fixed belongs_to primary key bug. 2012-04-26 11:25:47 -05:00
Taylor Otwell
ca06582369 Add some events to Eloquent models. 2012-04-26 09:30:34 -05:00
Taylor Otwell
9cee86ffb9 use array_values on relationship matches. 2012-04-24 22:38:30 -05:00
Ben Corlett
af6d76f713 Adding having() support to the Fluent query builder.
Signed-off-by: Ben Corlett <bencorlett@me.com>
2012-04-25 11:18:50 +10:00
Taylor Otwell
1dea9852a9 fix eager loading of belongs_to relationships when all keys are null. 2012-04-24 10:37:40 -05:00
Taylor Otwell
94948cf675 Fix Eloquent eager loading matching. 2012-04-23 16:08:57 -05:00
Taylor Otwell
a92ab1ca30 Fixing bugs. 2012-04-20 11:35:47 -05:00
Taylor Otwell
b9d573467a Merge pull request #531 from markhuot/develop
Syncing Up Magic Methods
2012-04-18 18:50:19 -07:00
Taylor Otwell
b7ac667405 tweak belongs to eager constraining. 2012-04-17 14:33:17 -05:00
Mark Huot
49384514ef The __get() magic method runs three checks before giving up but the __isset() method only runs two checks. This syncs the logic to ensure that __get() and __isset() are looking at the same possibilities. 2012-04-13 10:20:34 -03:00
Taylor Otwell
1847a369fb fixed eloquent datetime bug when determining dirty attributes. 2012-04-11 16:08:15 -05:00
Taylor Otwell
94b8582865 Add DateTime support to database binding layer.
Signed-off-by: Taylor Otwell <taylorotwell@gmail.com>
2012-04-10 15:03:42 -05:00
Taylor Otwell
fda19731c5 Fixing update handling in Has_Many and Has_One relationships.
Signed-off-by: Taylor Otwell <taylorotwell@gmail.com>
2012-04-10 11:26:03 -05:00
Taylor Otwell
1a5d4250d1 fix conflicts. 2012-04-10 10:10:31 -05:00
Taylor Otwell
2e7cca1d0b Merge pull request #512 from Mikaweb/patch-1
Misspelt word corrected!
2012-04-10 07:49:05 -07:00
Joe Wallace
f7aee0ca2a Model::table() uses class_basename() helper - which properly discards namespaces on *nix systems
Signed-off-by: Joe Wallace <joew@atiba.com>
2012-04-09 11:28:40 -05:00
Maxime Dizerens
3850f575f0 Misspelt word corrected! 2012-04-07 00:03:33 +03:00
Taylor Otwell
8a687053a8 fix conflicts. 2012-04-05 09:33:50 -05:00
Taylor Otwell
cc4514e8f6 Fix bug in many to many eager loading.
Signed-off-by: Taylor Otwell <taylorotwell@gmail.com>
2012-04-05 09:21:28 -05:00
Taylor Otwell
d1adc8c181 Merge pull request #484 from kbanman/bugfix-pivot
Timestamps are optional in many-to-many pivot table
2012-04-04 08:36:01 -07:00
Taylor Otwell
eda46a815e fix eloquent model attribute resolution. 2012-04-04 10:33:24 -05:00
Taylor Otwell
6fdccd7496 Fixing bug.
Signed-off-by: Taylor Otwell <taylorotwell@gmail.com>
2012-04-03 11:00:45 -05:00
Taylor Otwell
517da41a72 Tweaking has_many "save" method.
Signed-off-by: Taylor Otwell <taylorotwell@gmail.com>
2012-04-03 10:56:55 -05:00
Taylor Otwell
d0a701e8f7 Tweaking has_many "save" method.
Signed-off-by: Taylor Otwell <taylorotwell@gmail.com>
2012-04-03 10:55:04 -05:00
Taylor Otwell
df70987679 added sync method to has_many relationship. 2012-04-03 10:48:01 -05:00
Kelly Banman
587a80acbb Timestamps are optional in many-to-many pivot table
Signed-off-by: Kelly Banman <kelly.banman@gmail.com>
2012-04-02 14:59:44 -07:00
Colin Viebrock
7293c0448d One more change (comments may need to be altered)
Signed-off-by: Colin Viebrock <colin@viebrock.ca>
2012-04-02 11:38:12 -05:00
Colin Viebrock
7d4a346f84 Adding Schema::rename('oldtable','newtable') support
Signed-off-by: Colin Viebrock <colin@viebrock.ca>
2012-04-02 11:30:53 -05:00
Taylor Otwell
363b7c54df Merge branch 'staging' into develop 2012-04-01 13:51:05 -05:00
Taylor Otwell
63ff04991b fixing merge conflicts. 2012-04-01 13:50:55 -05:00
Taylor Otwell
d2f35900cd fix where in shortcut and response header casing problem. 2012-04-01 13:48:27 -05:00
Taylor Otwell
369ecd80f7 Merge branch 'staging' into develop 2012-03-30 08:45:16 -05:00
Taylor Otwell
636d05665c fix merge conflicts. 2012-03-30 08:44:23 -05:00
Taylor Otwell
75f6384767 fix eloquent->delete bug. 2012-03-30 08:41:52 -05:00
Taylor Otwell
3e0d468470 Merge branch 'staging' into develop 2012-03-29 22:11:42 -05:00
Taylor Otwell
062ae8756c fix conflicts. 2012-03-29 22:11:30 -05:00
Taylor Otwell
b5dd77d387 Fixing Eloquent constructor bug.
Signed-off-by: Taylor Otwell <taylorotwell@gmail.com>
2012-03-29 22:04:04 -05:00
Taylor Otwell
579bc8719f cleaning up code. 2012-03-29 17:13:13 -05:00
Taylor Otwell
144117c0a1 cleaning up the eloquent model class. 2012-03-29 16:58:08 -05:00
Taylor Otwell
cd71c1e517 added sync method to has many and belongs to entity relationship. 2012-03-29 16:20:38 -05:00
Taylor Otwell
17cabd47e6 Added to_array() and $hidden variable to the Eloquent base model.
Signed-off-by: Taylor Otwell <taylorotwell@gmail.com>
2012-03-29 14:12:03 -05:00
Taylor Otwell
720d9de582 Fix bug in eloquent model hydration.
Signed-off-by: Taylor Otwell <taylorotwell@gmail.com>
2012-03-28 11:07:26 -05:00
Taylor Otwell
9dee79ba00 Fixing SQLite connector.
Signed-off-by: Taylor Otwell <taylorotwell@gmail.com>
2012-03-27 10:25:42 -05:00
Taylor Otwell
8af11e6d61 Fix bug in eloqueny hydrator. 2012-03-26 16:49:31 -05:00
Taylor Otwell
5a59c5f317 Don't use mass assignment in hydrator. 2012-03-26 16:36:23 -05:00
Taylor Otwell
37fd54b848 Merge pull request #448 from danielboendergaard/patch-1
Fixed problem with Eloquent2 pivot tables
2012-03-26 13:26:46 -07:00
Taylor Otwell
ba4d1a89c8 Removed add_ magic method from eloquent model as this will be a 3.2 feature. 2012-03-26 10:56:42 -05:00
Daniel Bondergaard
3639d2c46f Fixed pivot model hydration loading in Eloquent2
Signed-off-by: Daniel Bondergaard <danielboendergard@gmail.com>
2012-03-26 14:17:49 +02:00
Taylor Otwell
57cf817de4 Fix pivot constraints on ->pivot() method of many-to-many.
Signed-off-by: Taylor Otwell <taylorotwell@gmail.com>
2012-03-22 21:47:35 -05:00
Taylor Otwell
879e56df75 Merge branch 'master' into develop 2012-03-22 21:26:32 -05:00
Taylor Otwell
e96f75e8cc Fixing bugs in database layer. 2012-03-22 13:12:27 -05:00
Taylor Otwell
b6615ddbee Fixing a few things in Eloquent 2. 2012-03-22 11:00:13 -05:00
Phill Sparks
d1de7b9ffe Fix named keys on Schema columns.
Signed-off-by: Phill Sparks <me@phills.me.uk>
2012-03-22 14:27:37 +00:00
Taylor Otwell
268e6e460d Updating $eloquent->dirty() method. 2012-03-22 09:18:11 -05:00
Taylor Otwell
e5b3b196ab Updated change-log. Prepend table names to default index names in schema. 2012-03-22 09:11:51 -05:00
Taylor Otwell
453d4154f2 Added "pivot" method to has_many_and_belongs_to. 2012-03-22 09:07:21 -05:00
Taylor Otwell
0961f8f766 Fixing eloquent 2 query->first method. 2012-03-21 22:00:30 -05:00
Taylor Otwell
30204e082b Fixing bugs in eloquent relating to namespaces. 2012-03-21 15:45:05 -05:00
Taylor Otwell
bb2f458304 Added "add_" magic method to eloquent model. 2012-03-21 14:23:46 -05:00
Taylor Otwell
afb33c1775 Fix bug with table prefix and columns. 2012-03-21 13:10:59 -05:00
Taylor Otwell
91a6cb882e Added wrap_value function to grammar. 2012-03-21 12:06:31 -05:00
Taylor Otwell
0893f3cca6 Merge branch 'master' into develop 2012-03-21 10:59:35 -05:00
Taylor Otwell
43212f8505 Fix bug in eloquent model. 2012-03-21 10:38:39 -05:00
Taylor Otwell
ce9f4f1db7 Added support for on_delete and on_cascade of foreign keys. 2012-03-21 10:33:06 -05:00
Taylor Otwell
4336bb885a Fix attribute retrieval bug in Eq2. 2012-03-20 11:43:11 -05:00
Taylor Otwell
079400ff3d Allow passing in a model instance to relationship insert / update methods. 2012-03-20 09:03:31 -05:00
Taylor Otwell
e540fd3b6d Automatically detect eloquent table names. 2012-03-19 14:11:11 -05:00
Taylor Otwell
d80730cf0d Removed transaction method from Eloquent model since it is made pointless by DB::transaction. 2012-03-19 08:43:07 -05:00
Anton Khodakivskiy
1044367c1e added default values to the signature of Query::left_join to allow closure-based join conditions 2012-03-19 07:47:20 -04:00
Taylor Otwell
0455438ebe Added transaction method to database connection and eloquent model. 2012-03-18 22:39:04 -05:00
Taylor Otwell
fcff36a0ac Added related model updating from belongs_to relationship. 2012-03-17 23:14:01 -05:00
Taylor Otwell
68b4e55336 Cleaning up code.
Signed-off-by: Taylor Otwell <taylorotwell@gmail.com>
2012-03-17 16:12:26 -05:00
Taylor Otwell
8c209a7a61 Just cleaning up some code.
Signed-off-by: Taylor Otwell <taylorotwell@gmail.com>
2012-03-17 15:42:01 -05:00
Taylor Otwell
762f2402c3 Fixing bugs and improving.
Signed-off-by: Taylor Otwell <taylorotwell@gmail.com>
2012-03-16 15:32:26 -05:00
Taylor Otwell
b5e75f6fcf Fixing bugs and improving.
Signed-off-by: Taylor Otwell <taylorotwell@gmail.com>
2012-03-16 14:08:28 -05:00
Taylor Otwell
dc92dd264d Adding auto detection of intermediate table names.
Signed-off-by: Taylor Otwell <taylorotwell@gmail.com>
2012-03-16 13:01:48 -05:00
Taylor Otwell
c3d95122e4 Fixing bugs… adding better pivot support.
Signed-off-by: Taylor Otwell <taylorotwell@gmail.com>
2012-03-16 11:29:21 -05:00
Taylor Otwell
c9c0ddf569 Fixing bugs in Eq2.
Signed-off-by: Taylor Otwell <taylorotwell@gmail.com>
2012-03-16 10:29:43 -05:00
Taylor Otwell
d6d667af90 Added Eloquent 2.
Signed-off-by: Taylor Otwell <taylorotwell@gmail.com>
2012-03-16 08:37:31 -05:00
Taylor Otwell
3de0d1af66 Make the query where_nested method public.
Signed-off-by: Taylor Otwell <taylorotwell@gmail.com>
2012-03-15 16:12:18 -05:00
Taylor Otwell
afcb60ec60 Adding comment in database grammar.
Signed-off-by: Taylor Otwell <taylorotwell@gmail.com>
2012-03-12 10:31:12 -05:00
Kelly Banman
17f7389bc5 Fix prefixing raw tables 2012-03-09 08:48:20 -08:00
Taylor Otwell
6f7780a0f8 Merge branch 'refs/heads/master' into develop 2012-03-07 14:13:01 -06:00
Shawn McCool
17ac74d7f8 made all sqlite fields nullable to fix various problems with the difference in sqlite's null functionality 2012-03-07 20:52:17 +01:00
Taylor Otwell
46595ce55e Unsigned only supported by MySQL.
Signed-off-by: Taylor Otwell <taylorotwell@gmail.com>
2012-03-04 14:28:49 -06:00
Taylor Otwell
f3df013753 Added support for decimal data type in schema.
Signed-off-by: Taylor Otwell <taylorotwell@gmail.com>
2012-03-04 14:23:59 -06:00
Taylor Otwell
d43157b61f Fix drop_foreign SQL grammar for MySQL.
Signed-off-by: Taylor Otwell <taylorotwell@gmail.com>
2012-03-02 10:27:37 -06:00
Taylor Otwell
1d93cab0d0 Cleaning up foreign key support. Added drop_foreign command.
Signed-off-by: Taylor Otwell <taylorotwell@gmail.com>
2012-03-02 10:23:27 -06:00
Taylor Otwell
c002ae6337 Use constraints for "unique" on Postgres schemas.
Previous was using CREATE INDEX, should be using ADD CONSTRAINT as this will create the index automatically per Postgres documentation.

Signed-off-by: Taylor Otwell <taylorotwell@gmail.com>
2012-03-02 09:54:43 -06:00
Taylor Otwell
1302ded5f8 Added foreign key support to schema builder for MySQL, Postgres, and SQL Server.
Signed-off-by: Taylor Otwell <taylorotwell@gmail.com>
2012-03-02 09:41:30 -06:00
Colin Viebrock
b7d068f2f2 Move method into grammar.php instead of duplicating in each grammar 2012-02-29 15:21:20 -06:00
Colin Viebrock
26c7273493 Add unsigned() modifier, so you can create unsigned integer columns 2012-02-29 15:09:13 -06:00
Taylor Otwell
621fee09be cleaning up code.
Signed-off-by: Taylor Otwell <taylorotwell@gmail.com>
2012-02-27 09:28:21 -06:00
Taylor Otwell
484a737382 make the pdo fetch style configurable. 2012-02-24 11:35:02 -06:00
Taylor Otwell
9804bb55dc comment cleanup. 2012-02-24 11:17:56 -06:00
Taylor Otwell
f6ef233d39 alias aggregate column in query grammar. 2012-02-21 09:23:24 -06:00
Taylor Otwell
fe0b4b287d cleaning up code. 2012-02-17 16:30:11 -06:00
Taylor Otwell
3507d15323 fix charset in mysql and pgsql connectors. 2012-02-17 14:38:25 -06:00
Taylor Otwell
faa2eec3b9 consolidate database methods into db::query. 2012-02-17 08:47:06 -06:00
Taylor Otwell
e828b6c0c3 all database exceptions now include SQL and bindings in message for easier debugging. 2012-02-16 22:32:09 -06:00
Taylor Otwell
dd6402c648 prefix built-in events with laravel. 2012-02-16 16:26:39 -06:00
Taylor Otwell
0e63717be9 use default index names on implicit indexes. 2012-02-16 15:37:06 -06:00
Taylor Otwell
317e8db81f change query event name. 2012-02-16 09:08:00 -06:00
Taylor Otwell
36834c1118 add database.profile config option. 2012-02-16 08:46:48 -06:00
Taylor Otwell
b29f8a88fe add default value for index names. 2012-02-15 16:17:47 -06:00
Taylor Otwell
ab17ea674a fix bug in db profiling. 2012-02-15 13:29:37 -06:00
Taylor Otwell
479b3f6773 cleaning up various codes. 2012-02-13 23:51:33 -06:00
Taylor Otwell
620f3ba91f fixing a bug and cleaning. 2012-02-12 21:52:28 -06:00
Taylor Otwell
b0a223aa4b cleaning up comment. 2012-02-12 21:27:07 -06:00
Taylor Otwell
0f2d311739 cleaning up some code. 2012-02-12 16:34:11 -06:00
Taylor Otwell
3a92facc76 updated routing to fix several issues. 2012-02-12 14:48:36 -06:00
Taylor Otwell
490eb0f5bf remove die. 2012-02-08 11:35:29 -06:00
Taylor Otwell
5e59a72b5b fix bug in paginator. 2012-02-08 11:16:55 -06:00
Taylor Otwell
e88d2213ab added support for complex joins on query builder. 2012-02-08 10:53:58 -06:00
Taylor Otwell
0c133dd96c trimming comment. 2012-02-06 23:02:49 -06:00
Taylor Otwell
8240b2ffd1 move shortcut method into grammar. 2012-02-06 22:09:15 -06:00
Taylor Otwell
087f50a52c cast bindings to array. 2012-02-06 21:39:30 -06:00
Taylor Otwell
1351a2b189 cleaning up code. 2012-02-06 20:19:29 -06:00
Taylor Otwell
bbae90adad fix pagination comment. 2012-02-06 15:57:37 -06:00
Taylor Otwell
cd17761f72 fix distinct problems in paginator. 2012-02-06 15:28:03 -06:00
Taylor Otwell
2e492a710a Merge pull request #308 from sparksp/patch-3
SQLServer::limit and ::offset return strings
2012-02-04 18:00:21 -08:00
Phill Sparks
8e5a143bbe SQLServer::limit and ::offset return strings 2012-02-04 21:33:25 +00:00
Phill Sparks
62072e5281 PHPDoc fixes 2012-02-04 21:30:52 +00:00
Taylor Otwell
3c016285a1 make log function non-static. 2012-02-01 08:27:46 -06:00
Taylor Otwell
982e009a96 added query event for hooking into database for logging. 2012-02-01 08:25:54 -06:00
Taylor Otwell
ea13ddfb7f fix aggregate selecting bug. 2012-01-30 10:38:12 -06:00
Taylor Otwell
1ec6fc766c added support for database table prefixes. 2012-01-29 13:07:15 -06:00
Taylor Otwell
97fcea1e51 cleaned up paths. 2012-01-28 14:55:08 -06:00
Taylor Otwell
f44c565ee4 converted path constants to $GLOBALS. 2012-01-27 16:17:43 -06:00
Taylor Otwell
d4c5114792 code quality and backreference support in controllers. 2012-01-25 16:07:16 -06:00