Ceeram
02b8bce641
Fix cs error introduced after resolving merge conflict with master to 2.6
2014-07-21 14:01:43 +02:00
mark_story
051d78c1a5
Merge branch 'master' into 2.6
...
Conflicts:
lib/Cake/Model/Model.php
2014-07-16 23:11:58 -04:00
chinpei215
ace30fdd8a
Fix a race condition problem
...
Prevents Model::save() from generating a query with WHERE 1 = 1 on race condition.
Refs #3857
2014-07-12 23:27:39 +09:00
mark_story
03c2a8b722
Unify datetime column default values between MySQL and Postgres.
...
Datetime columns should have 'default' => null, in both Postgres and
MySQL.
Fixes #3837
2014-07-11 23:10:16 -04:00
mark_story
9fd1a51a52
Merge branch 'master' into 2.6
2014-07-10 14:39:32 -04:00
David Yell
79be5e6805
Update Model.php
...
Fixed the case on the link to the book, to match the anchor in the page.
2014-07-10 10:46:48 +01:00
mark_story
3a70d9c033
Merge branch 'master' into 2.6
2014-07-09 10:17:05 -04:00
Ceeram
a266a9493d
minor optimisation, refs comments on 81875cfeb1
2014-07-04 17:25:41 +02:00
mark_story
765be87d88
Overwrite the schemaName property if it is not defined in the class.
...
If a model class does not define a schemaName we should use the
datasource's schemaName. We can assume that people using schemaName want
to lock the model onto a specific schema given the changes in #3210
Fixes #3720
2014-07-03 21:53:54 -04:00
ADmad
e410501791
Fix CS errors.
2014-07-03 23:13:55 +05:30
mark_story
2bcd817367
Merge branch 'master' into 2.6
2014-07-03 11:13:06 -04:00
euromark
974ca851c2
Correct doc blocks according to cs guidelines.
...
Remove superfluous empty lines.
2014-07-03 15:36:42 +02:00
mark_story
b1610c145e
Merge branch 'master' into 2.6
2014-07-02 23:39:16 -04:00
mark_story
33a5b6e451
Fix additional missing API doc tags.
2014-07-02 23:38:34 -04:00
mark_story
91721244a4
Fix more doc block errors in lib/
2014-06-27 22:58:34 -04:00
Mark Story
e9da7b8f80
Merge pull request #3596 from zeroasterisk/2.6
...
MySQL DbdSource alter field support 'after'
2014-06-25 23:10:29 -04:00
mark_story
a2673d8bf0
Merge branch 'master' into 2.6
...
Conflicts:
lib/Cake/Core/App.php
2014-06-25 09:22:10 -04:00
euromark
b3507b199a
Update doc blocks regarding return $this
2014-06-25 00:06:51 +02:00
Anatoliy Petrovskiy
ad678e3988
improving acl perfomance
2014-06-23 13:51:52 +03:00
Anatoliy Petrovskiy
bb15271622
improving acl perfomance by adding indexes on acl tables and reorganization joins in getting acl node function
2014-06-20 20:49:02 +03:00
mark_story
8e14b2f807
Merge branch 'master' into 2.6
2014-06-11 23:05:59 -04:00
Bryan Crowe
d8b4c3967c
Fix typo
2014-06-10 23:31:42 -04:00
ADmad
0b4ba0b049
Fix api docblocks for behaviors.
2014-06-10 00:38:44 +05:30
mark_story
146053c980
Update datasource API docs.
2014-06-06 14:06:32 -04:00
José Lorenzo Rodríguez
932bf47481
Merge pull request #3604 from Haititi/2.6-save-atomic
...
2.6 add 'atomic' option to "save()" API - delivery
2014-06-05 13:55:52 +02:00
ADmad
1d40f3e685
Fix API docblock CS errors.
2014-06-05 00:28:55 +05:30
Haithem BEN GHORBAL
31615ce415
add 'atomic' option to "save()" API
...
This commit adds a transaction context to 'save()' API in order to rollback
possible modifications done in some 'Model.beforeSave' listener callback.
This will allow cakephp 2.x to behave like 3.0 .
It uses try/catch to better handle transaction.
Previous save() API is renamed to protected _doSave() method.
A new save() method is created for transaction handling.
'atomic' option is disabled for internal 'save()' call.
2014-06-03 09:37:17 +02:00
mark_story
92eeef8ae0
Merge branch 'master' into 2.6
2014-06-02 22:57:25 -04:00
ADmad
e7debd8692
More API docblock CS fixes.
2014-06-02 18:27:11 +05:30
Stefan Dickmann
91907b5c6c
correct docblock
...
invalid certificate domain
2014-06-01 13:23:47 +02:00
ADmad
3d9b2b80cb
More API docblock fixes.
2014-06-01 03:06:05 +05:30
alan bount
c273ed8d2c
MySQL DbdSource alter field support 'after'
...
The ALTER FIELD for MySQL should support 'after' just like the ADD FIELD
2014-05-29 11:06:44 -04:00
Haithem Ben Ghorbal
35c2a7ef31
restore previous (erroneous ?) behaviour
2014-05-29 02:36:13 +02:00
Haithem Ben Ghorbal
67af8b37db
clean code and remove unneeded checks
2014-05-28 23:53:47 +02:00
Haithem BEN GHORBAL
d4a0883cb9
fix typo/coding style
2014-05-28 18:31:03 +02:00
Haithem BEN GHORBAL
a8e410ee20
fix save with habtm returning false
2014-05-28 18:17:16 +02:00
Mark Story
9c9d45596f
Merge pull request #3478 from Schlaefer/#3303-lengthBetween
...
closes #3303 RFC: Rename Validator::between() into Validator::length()
2014-05-24 16:48:05 -04:00
mark_story
587f2da09e
Merge branch 'master' into 2.6
...
Conflicts:
lib/Cake/VERSION.txt
2014-05-22 14:29:43 -04:00
mark_story
81875cfeb1
Optimize renew().
...
Don't call session_id() twice when we can use a local variable to store
the current session id.
Fixes #3531
2014-05-22 14:28:56 -04:00
mark_story
2e4d6eb009
Merge branch 'master' into 2.6
...
Conflicts:
lib/Cake/VERSION.txt
2014-05-16 21:26:30 -04:00
Kenshin Okinaka
91cb3ddc27
Unset $db in DboSource::read().
...
After calling $db->queryAssociatin(), it is necessary to unset db.
This reverts commit 52d425737a
.
2014-05-13 21:17:34 +09:00
Schlaefer
4848b63189
closes #3303 RFC: Rename Validator::between() into Validator::length()
2014-05-13 09:31:03 +02:00
mark_story
89cd114e6f
Merge branch 'master' into 2.5
2014-05-12 14:30:02 -04:00
Coen Coppens
91fbbdf6ca
Added $type as an argument.
...
See https://github.com/cakephp/cakephp/issues/2122
2014-05-12 12:08:06 +02:00
Stephen Cuppett
ed83df5bed
Fixes #3469 , explicit isset check for counterCache
2014-05-11 19:17:18 -04:00
Walther Lalk
2dd3cecfaa
Fixes issue with Sql Server driver when loading fixtures
...
Sqlserver::describe is expecting a model object (Unlike other drivers which work with either a object or string). While this does work under normal conditions, it causes a "Trying to get property of non-object" notice when using fixtures. The same problem also causes the testLimitOffsetHack test to fail.
This change does a simple test to ensure that the $model variable is an object before trying to access a property of it. All SqlServer tests are now passing.
2014-05-06 12:43:36 +02:00
ADmad
d466e00644
Merge branch 'master' into 2.5
...
Conflicts:
lib/Cake/Model/Datasource/DboSource.php
lib/Cake/Test/Case/Model/Datasource/Database/MysqlTest.php
lib/Cake/Utility/Folder.php
lib/Cake/VERSION.txt
2014-05-04 14:35:36 +05:30
euromark
7a287a6942
More coding standard corrections.
2014-04-29 14:19:33 +02:00
mark_story
de0062de77
Merge branch 'master' into 2.5
2014-04-25 22:10:02 -04:00
mark_story
9d19801cfa
Clear data and validationErrors *after* calling clearCache().
...
Having both properties cleaned after clearCache() means that you can use
the model data in specialized clearCache() implementations.
Fixes #3386
2014-04-24 09:19:00 -04:00
mark_story
d54fbe6f60
Merge branch 'master' into 2.5
2014-04-18 22:13:56 -04:00
Mark Story
d2fa1b444f
Merge pull request #3301 from ubermaniac/Sqlserver-trim
...
Trim $sql before checking for SELECT
2014-04-11 18:48:41 -04:00
Joseph Woodruff
9aeea2fcc3
Trim $sql before checking for SELECT
2014-04-11 15:25:07 -06:00
mark_story
bf9c3029cb
Merge branch 'master' into 2.5
2014-04-10 20:51:49 -04:00
euromark
8e0f15b3d6
Revert the removal of a BC relevant part.
2014-04-10 20:11:58 +02:00
euromark
0ece694a75
microptimize options and default merge and other string key array merges
2014-04-08 01:25:14 +02:00
euromark
cb0ac6f9f3
Add a note to offsetSet() on why it cannot chain.
2014-04-06 22:59:18 +02:00
Joseph Woodruff
8536371501
Sqlserver Datasource how properly appends the schemaName prefix in the describe() method
2014-04-02 13:59:04 -06:00
Joseph Woodruff
d526fdadc1
Base model class no longer changes an already defined schemaName value
2014-04-02 13:58:29 -06:00
mark_story
2fe8c4050b
Insert manual joins *after* generated joins.
...
Re-order query joins to make manually added joins be performed after
generated joins. This removes the need to workaround the current join
order, or redefine all association joins when you want to add an
additional join on a leaf table.
Refs #2179
Refs #2346
2014-03-23 21:09:08 -04:00
mark_story
8acb75425d
Merge branch 'master' into 2.5
...
Conflicts:
CONTRIBUTING.md
lib/Cake/Model/Datasource/DboSource.php
2014-03-21 22:55:28 -04:00
James Watts
2eadb89ff6
Update in_array() check to avoid fatal error
...
Enabling the $strict parameter to true avoids PHP's default behavior when search for an array in an array, which throws a fatal error if circular references exist - http://php.net/in_array#refsect1-function.in-array-parameters
2014-03-21 16:16:32 +01:00
ADmad
961f9d7669
Merge branch 'master' into 2.5
2014-03-16 20:17:24 +05:30
Wouter van Dongen
5035613157
* Fixed bug where select query in deleteAll could return wrong table name.
...
PDOStatement::getColumnMeta (in mysql.php) sometimes returns the actual
table name when using a MySQL view with the distinct select query, and not
the alias table name. By returning the actual table name the records
could not be removed.
By the way PDOStatement::getColumnMeta is an experimental function,
perhaps it's better to avoid it.
2014-03-14 15:20:12 +01:00
mark_story
3a226b03c3
Remove typehint from generateAssociationQuery()
...
While I think typehints are generally a good idea, this one broke a few
plugins, notably CakeDC/search. I don't think it is wise for 2.X release
to break BC in that way. I think reverting this change is probably the
safest path right now.
2014-03-12 23:42:21 -04:00
mark_story
5a944734b8
Remove typehint on $LinkModel argument.
...
Adding a typehint here causes errors in a few userland plugins. We
should honor the previous interface as best we can.
2014-03-12 23:30:46 -04:00
Mark Story
fda242f000
Merge pull request #2961 from ovidiupruteanu/patch-3
...
Sqlserver->describe failing for models with a schemaName
2014-03-11 21:03:54 -04:00
mark_story
c5b6dda82f
Merge branch 'master' into 2.5
2014-03-11 21:02:27 -04:00
Thomas Smith
4927cf6901
#2994 , unnecessary calls to Model::__isset(null)
2014-03-10 10:16:32 -07:00
ovidiupruteanu
7b1086e632
Add missing spaces
2014-03-06 05:18:31 +02:00
ovidiupruteanu
56a3f093a1
Sqlserver->describe failing for models with a schemaName
...
When models have a schemaName set it was searching for TABLE_NAME = 'schema_name.table_name'.
Instead it should search for TABLE_NAME = 'table_name' AND TABLE_SCHEMA = 'schema_name'
2014-03-06 04:54:03 +02:00
mark_story
2c5d96e916
Merge branch 'master' into 2.5
...
Conflicts:
lib/Cake/Model/Datasource/DboSource.php
2014-02-16 14:24:19 -05:00
mark_story
96a37d5917
Fix temporary associations that replace fields not being restored.
...
When binding temporary associations, fields should be restored
in the afterFind as the association will have become unbound.
Fixes #2816
2014-02-11 21:56:05 -05:00
mark_story
a5d50da040
Remove dead and unused code.
2014-02-11 16:38:24 -05:00
ADmad
9de3418079
Merge branch 'master' into 2.5
...
Conflicts:
lib/Cake/Model/Permission.php
2014-02-11 18:17:59 +05:30
Eric Martins
2793dca671
Fix ApiGen errors
2014-02-07 18:29:54 -02:00
Jimmy Madon
fcd41e45a7
Clarified ACL node lookup failed error.
...
Original error was ambiguous in stating whether the ARO node lookup failed or the ACO node lookup failed.
2014-02-05 18:25:14 +00:00
mark_story
be8ebfc005
Merge branch 'master' into 2.5
2014-02-05 09:22:46 -05:00
José Lorenzo Rodríguez
e36c954da7
Merge pull request #2693 from ADmad/2.5-session-start
...
Don't start a session if it's known to be empty.
2014-02-01 04:08:48 -08:00
Rachman Chavik
59549b7ebe
Fix: Changing boolean to integer for Postgres
...
Closes #2751 , CakeDC/migrations#149
2014-01-31 15:14:20 +07:00
mark_story
c1ab6fa9d1
Merge branch 'master' into 2.5
2014-01-30 10:13:37 -05:00
joostdekeijzer
987187ef8c
Fix #2721 in TranslateBehavior::beforeFind() supporting both Model::field('fieldname') and Model::read('fieldname')
2014-01-29 13:37:47 +01:00
Rachman Chavik
b83b59a9d7
Log errors instead of calling trigger_error()
2014-01-29 17:51:07 +07:00
ADmad
c093804b35
Merge branch 'master' into 2.5
2014-01-26 17:39:50 +05:30
mark_story
d7d8fc00d1
Check data with isset() before accessing it.
...
Don't blindly access data that may not exist.
Fixes #2712
2014-01-25 22:15:47 -05:00
ADmad
4407cdb010
Avoid code duplication.
2014-01-22 11:36:45 +05:30
ADmad
84932fcc4a
Don't start a session if it's known to be empty.
...
If an app only reads/checks the session there's no need to start a
session to know that the read/checked session value is empty.
Fixes #1981
2014-01-22 01:17:16 +05:30
mark_story
55e1619c59
Fix issue with find(count) and TranslateBehavior.
...
Fixes #2667
2014-01-18 21:54:09 -05:00
mark_story
75dd2ff1fb
Merge branch 'master' into 2.5
2014-01-16 15:20:40 -05:00
mark_story
3763350667
Add test for issue #2595
...
Fold conditions that did the same thing and add a test case.
Closes #2595
2014-01-06 21:21:13 -05:00
Raffaele
a4f138813b
Return value if value are 0
...
Save correctly if the value is 0, but after the find is returned as an empty string.
2014-01-03 15:46:09 +01:00
mark_story
3cee3b0e99
Merge branch 'master' into 2.5
...
Conflicts:
lib/Cake/VERSION.txt
2013-12-30 21:28:22 -05:00
Stephen Cuppett
ed749fdc97
Must double quote the schema name in query
...
Schema names with reserved words such as "create" will fail this query without double quotes.
Attempted prepared statement with ? placeholder. This failed with the following CakePHP error:
Error: A Database connection using "Postgres" was missing or unable to connect.
The database server returned this error: SQLSTATE[42601]: Syntax error: 7 ERROR: syntax error at or near "$1" LINE 1: SET search_path TO $1 ^
2013-12-29 21:43:56 -05:00
Rachman Chavik
c4f8289b53
Fix test by checking against an empty array instead of false
2013-12-27 12:37:39 +07:00
Ber Clausen
f30b43b4c9
Update documentation and typehint.
2013-12-21 22:02:45 -03:00
Ber Clausen
c15f7de164
Re-expose DboSource::fetchAssociated() for BC.
...
Internally use protected methods to fetch hasMany and hasAndBelongsToMany
associations.
2013-12-21 11:34:40 -03:00
Ber Clausen
5ccb77e25d
Be consistent with the result set variable name.
2013-12-21 10:57:40 -03:00
Ber Clausen
0adc062cfa
Process query only when needed.
2013-12-21 10:57:40 -03:00
Ber Clausen
422be67a03
Avoid recalculating whether the relationship is a self join.
2013-12-21 10:57:40 -03:00
Ber Clausen
86b69964ef
Be more semantic with variable names.
...
Isue less loockups for deep arrays.
A bit of documentation added.
2013-12-21 10:57:40 -03:00