Larry E. Masters
8f52cefdcc
Changing where bool is returned
2015-12-14 09:17:29 -06:00
Larry E. Masters
fac95baee7
Forcing bool return
2015-12-13 20:05:54 -06:00
chinpei215
726699ee7a
Magic call with custom finders
...
Now we can use findListBy, etc - closes #7674
2015-11-11 22:43:19 +09:00
mark_story
8c404ad6a7
Merge branch '2.7' into 2.8
2015-10-17 21:00:26 -04:00
mark_story
e2a1094e69
Define variables before they are used.
...
Refs #7563
2015-10-16 23:07:25 -04:00
mark_story
707915e693
Merge branch '2.7' into 2.8
2015-10-15 22:10:56 -04:00
Marc Würth
ed410dd12c
Do not mix void with other return types
...
Inspired by #7527
2015-10-10 15:49:00 +02:00
Marc Würth
de8aed534f
Add false as return value of field()
...
+ improve DocBlocks
2015-10-08 16:31:01 +02:00
mark_story
ae83e197dc
Merge branch '2.8' of github.com:cakephp/cakephp into 2.8
2015-09-27 11:13:12 -04:00
Mark Story
12f5aee5a2
Merge pull request #7447 from ravage84/2.7-lib-improvements
...
Various improvements to the CakePHP lib files
2015-09-25 12:14:00 -04:00
Marc Würth
e690662f0e
Various improvments to the CakePH Plib files
...
Mostly CS, doc blocks and explicit returning nulls.
2015-09-25 17:11:20 +02:00
Mark Scherer
81cbb52f74
Only array-wrap 'order' if it's not already an array.
2015-09-22 13:04:28 +02:00
Mark Story
9208a0857e
Merge pull request #7428 from burriko/fix-dbo-connection-issues
...
Fix use of $_connection in DboSource in 2.x
2015-09-21 21:38:20 -04:00
Graeme Tait
dc856b8508
Switch out is_null()
2015-09-21 17:00:20 +01:00
Graeme Tait
1b33efaad3
Check $_connection is not null before trying to use it
...
Stops a fatal error if calling isConnected() after disconnect().
2015-09-21 14:08:07 +01:00
Graeme Tait
8fae10a971
Set DboSource::$_connection to null on disconnect
2015-09-21 14:05:56 +01:00
Mark Scherer
97b6f8674c
Fix CS
2015-09-21 13:45:18 +02:00
mark
d8a55ad065
Allow CURRENT_TIMESTAMP for datetime columns - MySQL5.6+.
2015-09-16 14:16:58 +02:00
thomasv
1dbb6dd0e4
Update DatabaseSession.php
...
To prevent error: "Integrity constraint violation: 1052 Column 'id' in where clause is ambiguous" when using a custom Session object in relationship with another object (belongsTo <-| hasMany)
2015-09-10 00:25:39 +02:00
mark_story
60d7bbaa10
Always update updated/modified columns when a fieldList is used.
...
When a fieldList is used, and updated is not in the fieldList, the
column should continue to be updated even if the column has a value from
the user. Because the field is not in the fieldList, we must assume that
the intent is for the field to update automatically, as it would have if
the updated column was not present in the save data.
Refs #7076
2015-09-05 22:01:33 -04:00
James Tancock
fdb41e01bb
Alter Model::exists() to return false with no table
2015-08-18 13:07:30 +01:00
James Tancock
90a77f6ce5
Alter model exists to consider useTable
2015-08-16 19:06:12 +01:00
paolo
a7b5f8c3af
DboSource now check the actual status of connection by executing a dumb query on DB
...
This change makes it possible for developer to build reconnection logic
on MySQL connections which frequently time out in long running CLI
processes.
Cherry picked onto 2.7 from #7190 .
2015-08-07 21:59:28 -04:00
Mark Story
de4b44a37b
Merge pull request #7077 from dereuromark/2.7-static
...
Replacing self with static due to PHP5.3+. Following #7040 .
2015-07-23 22:27:37 -04:00
mark_story
c6e5026767
Fix issues saveMany & saveAssociated with boolean values.
...
For non-atomic, save operations that include models with boolean fields.
The first false value would cause the save to abort. This regression was
introduced in #6947 . Instead of checking the data from save() we should
be boolean casting save() to capture the success/failure.
Refs #7069
2015-07-22 00:41:10 -04:00
Mark Scherer
52e79987a2
Replacing self with static due to PHP5.3+. Following #7040 .
2015-07-21 10:22:53 +02:00
mark_story
47378427e3
Merge branch '2.6' into 2.7
2015-07-11 21:25:26 -04:00
mark_story
65c1745349
Add missing parameter to rawQuery()
...
Previously bound parameters were put in the incorrect position.
Refs #6992
2015-07-10 12:56:49 -04:00
mark_story
59a18e7709
Merge branch '2.6' into 2.7
2015-07-07 22:05:56 -04:00
hiromi2424
deb62c8887
#6935 Fix deep saving for hasMany could not handle validation errors correctly
2015-07-04 06:10:58 +00:00
Lawrence Barsanti
0b28c2e839
Added negative lookahead
...
It is possible to have multiple occurrences of 'as' in a field name.
Use the last occurrence of 'as' when extracting field name.
Tested with following examples:
"WeldCheck"."weld_id"
count(*) as WeldCheck__num_measurements
count(case decision when 2 then 1 else null end) as
WeldCheck__num_failures
avg(cast (WeldMeasurement.surface_indentation as bigint)) as
WeldCheck__avg_indentation
avg(cast (WeldMeasurement.circle_diameter as bigint)) as
WeldCheck__avg_diameter
2015-06-25 22:21:38 -04:00
mark_story
ae2ea1ea6c
Merge branch '2.6' into 2.7
2015-06-25 21:50:47 -04:00
mark_story
2f616a9e0c
Fix greedy regex operators in Postgres driver.
...
`*` is greedy in regex, and needs to be escaped so that SQL operators
don't cause invalid SQL conditions to be created.
Refs #6877
2015-06-24 23:39:26 -04:00
Mark Scherer
0524eb95ae
Documentation update
2015-06-01 16:14:15 +02:00
Mark Scherer
4ad001b9ca
Use options array.
2015-06-01 16:12:45 +02:00
Mark Scherer
670d93b6f6
Extract formatTreeList() from generateTreeList().
2015-06-01 12:36:20 +02:00
mark_story
d7d8b90986
Merge branch '2.6' into 2.7
2015-05-28 19:34:59 -04:00
mark_story
52a0d642ec
Fix incorrectly quoted table aliases in virtual fields.
...
DboSource::_quoteFields() is already a bit of a mess, and while I'm not
happy about having to add more regex replacement, it seems to be the
only reasonable solution given that the code is already 'parsing' SQL
to apply identifier quoting.
Fixes #6602
2015-05-20 22:40:47 -04:00
Mark Scherer
4f3602ad5f
Adjust bake, docblocks and tests for notBlank.
2015-05-17 22:27:16 +02:00
mark_story
096a2ebb72
Merge branch '2.6' into 2.7
...
Conflicts:
lib/Cake/Test/Case/TestSuite/ControllerTestCaseTest.php
lib/Cake/VERSION.txt
2015-04-20 15:42:54 -04:00
mark_story
b2958dad79
Re-add call to parent destructor.
...
In 762ebd4
a destructor was added to DboSource, this accidentally
removed the rollback on destruct that Datasource provides. Restoring
this via a parent call allows pending transactions to be rolled back at
the end of a request.
Fixes #6251
2015-04-01 20:37:06 -04:00
mark_story
446dd408bb
Renew the session even the session id is '0'.
...
This fixes AuthComponent not being able to log a user in when they
inadvertently change their session id to 0.
Refs #6053
2015-03-29 21:42:43 -04:00
mark_story
3151c53255
Merge branch '2.6' into 2.7
2015-03-23 22:50:09 -04:00
mark_story
827465fa30
Merge branch 'postgres_altercolum_error' into master
...
Merge changes from #5512 into master. This fixes changing columns in
postgres to integer from string types.
2015-03-14 22:23:43 -04:00
mark_story
c32e5559bb
Add test to ensure column was converted to integer.
...
Refs #5512
2015-03-14 22:23:17 -04:00
mark_story
8cadb553d7
Merge branch 'master' into 2.7
2015-03-14 22:08:53 -04:00
Marc Würth
4f9d764fc2
Fixed link to cookbook
2015-03-11 11:27:30 +01:00
mark_story
0b916cedbb
Merge branch 'master' into 2.7
2015-03-09 21:55:20 -04:00
mark_story
a9519d39f7
Fix whitelist being empty during afterSave.
...
whitelist should only be reset after afterSave event.
Refs #6028
2015-03-08 13:51:46 -04:00
ADmad
7173f21dc8
Type hint model param
2015-03-04 21:15:24 +05:30
ADmad
a1286e9e7d
Prefix fields with model alias
2015-03-04 21:11:18 +05:30
ADmad
6ad68ae1e2
Allow setting level (depth) of tree nodes on save.
...
Backported from 3.0.
2015-02-15 22:29:19 +05:30
ADmad
18246daf17
Merge branch 'master' into 2.7
2015-02-15 21:15:02 +05:30
ADmad
bdc6a1f010
Fix CS error
2015-02-15 19:22:44 +05:30
ADmad
0750a63ed4
Make code DRYer.
2015-02-15 18:36:30 +05:30
ADmad
844b4beaa6
Reduced code nesting.
2015-02-15 16:30:43 +05:30
ADmad
54fe7ed204
Add method to get depth of tree's node.
...
Backported from 3.0.
2015-02-01 17:27:46 +05:30
Mark Scherer
611889235a
Fix clear(). Add test cases.
2015-01-28 23:54:32 +01:00
Mark Story
35e0dc2bbd
Merge pull request #5760 from cakephp/master
...
Merge master into 2.7
2015-01-27 20:48:15 -05:00
AD7six
5e89e893f2
Ignore counter cache also
2015-01-23 08:30:34 +00:00
AD7six
c0ee49fe88
Remove callbacks to speed up saving
2015-01-23 08:30:26 +00:00
AD7six
838d23300b
Remove some exists checks by not validating
2015-01-23 08:29:59 +00:00
AD7six
51bd1d0a2b
If a PDOException is thrown, try again.
...
This can occur if the exists check returns no rows, but before this
request inserts into the database a _different_ thread inserts a
session record.
2015-01-23 08:28:08 +00:00
Ceeram
9ce75e6fd6
No need to get the datasource if column is defined in schema. Fixes #5712
2015-01-22 00:46:55 +01:00
mark_story
511ee1f776
Fix strict error with 2.6 code.
2015-01-19 21:43:14 -05:00
mark_story
3078a1eb52
Merge branch 'master' into 2.7
...
Conflicts:
lib/Cake/VERSION.txt
2015-01-16 22:22:26 -05:00
Mark Story
2a9f2d4b58
Merge pull request #5668 from cakephp/issue-5649
...
Fix numeric values not being quoted for MySQL set columns.
2015-01-15 21:29:57 -05:00
mark_story
d4a6d3f6c0
Fix numeric values not being quoted for MySQL set columns.
...
Set columns should always have their values quoted. Not quoting values
makes MySQL do bad things.
Refs #5649
2015-01-15 21:10:33 -05:00
David Steinsland
687d0b44f5
Backport of https://github.com/cakephp/cakephp/issues/5667
2015-01-15 11:00:27 +01:00
mark_story
ac9a212d44
Merge branch 'master' into 2.7
...
Conflicts:
lib/Cake/Utility/String.php
2015-01-11 15:25:18 -05:00
antograssiot
c2f298a8b7
Replace our custom code fence with markdown standard fence
2015-01-09 13:47:25 +01:00
Mark Story
c4f9727720
Merge pull request #5576 from istvanp/2.7
...
Prevent NULL value on NOT NULL column when value is an empty string
2015-01-06 21:23:53 -05:00
Istvan Pusztai
22b0275a58
Prevent NULL value on NOT NULL column when value is an empty string (MySQL)
2015-01-05 12:04:24 -05:00
euromark
52ecccb1a2
App::uses and usage replacements for String => CakeText.
2015-01-05 01:00:57 +01:00
euromark
394da88d23
Stay 100% BC for 2.7
2015-01-04 10:52:18 +01:00
euromark
39e0ce415d
Backport of 3.0 Session API hardening and clear().
2015-01-04 01:40:09 +01:00
mark_story
4cd2c8fdcb
Merge branch 'master' into 2.7
2015-01-03 14:34:55 -05:00
Mark Story
0a4cffc603
Merge pull request #5501 from cakephp/2.6-hotfix-session-tmp-dir
...
Also autocreate session folder in debug mode
2015-01-02 11:36:53 -05:00
Kaz Watanabe
e5fc1858f9
fix error at change type of text field to integer in PostgreSQL
2014-12-30 09:27:46 +09:00
mark_story
ec57fb4579
Fix length reflection in SQLServer
...
Don't reflect TEXT column lengths in SQLServer. Because SQLServer text
columns hold ~2GB of data there is no meaningful length to them.
Refs #5506
2014-12-29 16:47:50 -05:00
euromark
5aff618109
Also autocreate session folder in debug mode
2014-12-27 20:34:47 +01:00
Mark Story
7bbc3dfd90
Merge pull request #5470 from cakephp/2.7-session
...
Backport Session consume() to 2.x
2014-12-26 12:22:20 -05:00
euromark
813925abee
Backport Session consume()
2014-12-23 03:39:05 +01:00
mark_story
c540e2b798
Merge branch 'master' into 2.6
2014-12-22 21:38:58 -05:00
Mark Story
484b114e9b
Merge pull request #5384 from okinaka/fix-mysql-describe
...
2.5: Fixing Mysql::describe() for timestamp.
2014-12-21 21:27:27 -05:00
Rachman Chavik
45be270a7b
Enable use of Containable with TreeBehaviors
...
This patch allows Containable use with:
- TreeBehavior::getParentNode()
- TreeBehavior::children()
- TreeBehavior::getPath()
2014-12-20 16:32:20 +07:00
mark_story
4d6611b328
Merge branch 'master' into 2.6
...
Conflicts:
lib/Cake/VERSION.txt
2014-12-17 21:38:32 -05:00
OKINAKA Kenshin
8c008ad97d
Update.
2014-12-11 13:55:41 +09:00
mark_story
cf108dbff3
Remove duplicate order key.
...
This was a mistake made in 4b6dba0
.
Fixes #5376
2014-12-10 22:32:59 -05:00
OKINAKA Kenshin
5cff6aa746
Fixing Mysql::describe() for timestamp.
2014-12-11 10:31:19 +09:00
euromark
e1c128bb99
Consolidate with conditions sniff.
2014-12-09 03:17:35 +01:00
mark_story
ad2d6edda9
Merge branch 'master' into 2.6
2014-12-06 21:28:59 -05:00
Guy Warner
327fcb4846
Fix some missed doc block issues
2014-11-30 14:50:11 -07:00
Guy Warner
fb61d9393b
Add @trigger doc blocks of methods triggering CakeEvent
2014-11-30 14:45:40 -07:00
mark_story
543f05e3d0
Merge branch 'master' into 2.6
2014-11-29 22:00:00 -05:00
euromark
d0f75a03af
Allow RLIKE in conditions.
2014-11-26 19:56:58 +01:00
Stephen Cuppett
ffb7e86641
Enable sslmode for PostgreSQL connections
...
By default, PHP 5.5 and PostgreSQL PDO will not allow SSL connections. This adds the default of "allow", but also the user may override the setting to "require" or any of the other potential values.
See: http://php.net/manual/en/function.pg-connect.php
2014-11-20 22:37:39 -05:00
mark_story
23c5805763
Fix mistake with previous commit.
...
I forgot to put the correct variable into the query like a doofus.
Refs #4168
2014-11-18 22:03:30 -05:00
mark_story
ddc3eee84c
Use name() instead of hand quoting sequence names.
...
By using name() we can easily accomodate postgres sequences that exist
out side of sequences.
Fixes #4168
2014-11-17 22:47:07 -05:00
mark_story
decce4daf2
Merge branch 'master' into 2.6
2014-11-14 21:25:09 -05:00
Mark Story
f570f931ce
Merge pull request #5159 from cakephp/issue-5155
...
Add order=>false to all treebehavior queries.
Refs #5155
2014-11-14 10:02:17 -05:00
mark_story
4b6dba0c0a
Add order=>false to all treebehavior queries.
...
Models can define default order conditions that will cause issues with
postgres. By setting order=>false on all the queries emitted by
TreeBehavior, we can avoid this issue and not have issues with models
that define a default ordering.
Refs #5155
2014-11-13 21:21:47 -05:00
Bryan Crowe
e3e54d40fa
Fix CS, remove extra space
2014-11-13 16:47:10 -05:00
mark_story
6092c168a9
Fix issues with sqlite field parsing.
...
The previous attempt would still fail on unions or derived table join
queries. This new approach is a bit slower but more robust.
Refs #3972
2014-11-12 20:49:19 -05:00
mark_story
93a6fd5648
Fix SQLite parsing fields incorrectly when using subqueries.
...
When using subqueries or joining against tables containing FROM the
results were bizzare and unexpected. By tokenizing the entire query we
can more accurately grab the fields.
Refs #3972
2014-11-11 23:16:08 -05:00
watermark
8712dc01df
Cleanup of isUnique
...
isUnique takes the count of the args multiple times. Store the count in a variable to cut down on overhead.
2014-11-11 16:13:16 -05:00
Mark Story
4242ce453f
Merge pull request #5093 from cakephp/2.6-returns
...
Simplify return types.
Update code to use documented return types where possible, and reduce number of return types.
2014-11-08 14:58:22 -05:00
euromark
41c646c5a1
Simplification of return types. No need to return more mixed than necessary.
2014-11-08 20:07:47 +01:00
mark_story
0e4fb9d648
Merge branch 'master' into 2.6
2014-11-07 15:13:46 -05:00
mark_story
dac8b7b644
Update return type for Model::saveField().
...
Fixes #5086
2014-11-05 20:37:43 -05:00
euromark
345a18f15f
Merge branch 'master' into 2.6
2014-11-05 23:29:06 +01:00
euromark
0d5d6b19b5
Wording correction.
2014-11-05 13:14:45 +01:00
euromark
768f2c809c
Correct doc block return types.
2014-11-05 13:03:27 +01:00
mark_story
48101e6bf5
Merge branch 'master' into 2.6
2014-11-04 22:44:11 -05:00
Mark Story
96b82e4226
Merge pull request #5021 from dereuromark/master-mysql
...
Fix IN replacement in virtual fields for MYSQL.
2014-11-04 08:24:03 -05:00
mark_story
579b16d90b
Merge branch 'master' into 2.6
2014-10-30 21:20:53 -04:00
Mark Story
a8c5b70b22
Merge pull request #4489 from busgurlu/patch-1
...
to correctly return SET() type
2014-10-30 19:56:47 -04:00
euromark
e5b45bcdea
Fix IN replacement in virtual fields for MYSQL.
2014-10-30 19:14:04 +01:00
mark_story
4b5783c5fe
Add deterministic ordering to translate associations.
...
Having a deterministic ordering based on the primary key resolves
tests potentially failing when postgres returns data in a non-sequential
order.
2014-10-24 22:21:06 -04:00
Marc Würth
2ad181b6e1
Now the tableParameters array gets escaped through values(), too
2014-10-16 19:10:52 +02:00
Marc Würth
84b0fe1c88
Added comment to $tableParameters array
2014-10-16 16:06:33 +02:00
mark_story
1c440e2cb2
Merge branch '2.6' of github.com:cakephp/cakephp into 2.6
2014-10-13 21:11:52 -04:00
mark_story
87fcc9f0b9
Merge branch 'master' into 2.6
...
Conflicts:
lib/Cake/VERSION.txt
2014-10-13 21:11:38 -04:00
mark_story
50b3893e65
Make rule sniff less complicated and tidy up doc block.
...
Refs #4871
2014-10-13 17:59:31 -04:00
Rachman Chavik
dcb605c700
Possible fix for isUnique backward compatibility
2014-10-13 19:46:10 +07:00
ADmad
6dc98afa1e
Merge branch 'master' into 2.6
...
Conflicts:
lib/Cake/VERSION.txt
2014-10-12 20:20:14 +05:30
ADmad
ecf030796b
Fix docblock
2014-10-11 19:37:22 +05:30
Ceeram
1dfd3405a4
TranslateBehavior now uses original atomic option value, if set
2014-10-10 14:17:16 +02:00
mark_story
39011cd9d8
Fix Model::isUnique() not working as a validator.
...
While it *did* work for single fields, isUnique could not be used to
validate the uniqueness across multiple fields as documented. Because
validation methods pass arguments in an order the validator did not
expect the validation method would not work correctly.
Fixes #4571
2014-10-09 22:49:17 -04:00
ADmad
94e718372a
Make CakeSession::read() return null for all failure cases.
2014-10-09 19:27:27 +05:30
suzuki86
e4c0dee6ee
Fix small typo
2014-10-08 23:37:38 +09:00
mark_story
af43bc1706
Merge branch 'master' into 2.6
2014-09-25 22:39:51 -04:00
mark_story
1877cab341
Fix UUID primary key columns not being reflected properly.
...
When UUID columns are converted into varchar(36) they should also be
default = null, null = false.
Fixes #4695
2014-09-23 22:16:18 -04:00
mark_story
0d11cf7a33
Merge branch 'master' into 2.6
2014-09-14 23:26:33 -04:00
mark_story
9e4446fe5f
Trim whitespace from columns before checking for operators.
...
Fixes #4599
2014-09-13 21:50:35 -04:00
ADmad
3fb252ad2f
Merge branch 'master' into 2.6
2014-09-13 00:37:16 +05:30
euromark
e3dc51bb68
Manually correct remaining casts.
2014-09-10 16:40:22 +02:00
euromark
04ef39217f
Take care of more int casts.
2014-09-10 16:29:23 +02:00
euromark
e77f96d8b7
Use (int) cast instead of intval() function for performance reasons and to unify it.
2014-09-10 15:52:57 +02:00
mark_story
734bb9223b
Merge branch 'master' into 2.6
...
Conflicts:
lib/Cake/Core/App.php
lib/Cake/VERSION.txt
2014-09-06 23:04:20 -04:00
Burak USGURLU
996ad04b95
to correctly return SET() type
2014-09-04 18:07:30 +03:00
Mark Story
f82fd2d982
Merge pull request #4463 from ravage84/deprecated-annotaions
...
Update all @deprecated annotations
2014-09-04 08:48:45 -04:00
José Lorenzo Rodríguez
b5bfbfcf15
Merge pull request #4223 from chinpei215/2.6-issue2529-fix
...
Fix different format of $results in afterFind
2014-09-03 10:39:37 +02:00
mark_story
638d2ea7b6
Add array cast for method_cache data.
...
Fixes #4186
2014-09-02 22:39:28 -04:00
Marc Würth
67ba9cb406
Update all @deprecated annotations
...
to adhere to the @deprecated <version> <description> format, where version and description are mandatory.
2014-09-02 17:03:22 +02:00
ADmad
d60cd3ab2f
Revert "Merge pull request #4405 from php-engineer/master-session-bugfix"
...
This reverts commit 5863adda42
, reversing
changes made to 4c37cf6d4b
.
There was no real issue. The lack of session cookie in CLI makes writing
tests a bit tricky which caused the confusion. Refs #4405 , #4451 .
2014-09-01 00:17:53 +05:30
mark_story
7c316bbc56
Merge branch 'master' into 2.6
...
Conflicts:
lib/Cake/basics.php
2014-08-30 21:28:11 -04:00
Jeremy Harris
2dac6d29c2
Clearing HABTM (unique) when HABTM array is empty, refs #2461
2014-08-28 17:52:13 -05:00
chinpei215
31204832c2
Ensure that afterFind is called when using 'joins' with 'recursive' = -1
2014-08-27 15:16:13 +09:00
chinpei215
b74774bb0c
hasOne/belongsTo associations should contain associated records in afterFind
...
Before 1fe943d6f1
,
afterFind() is called twice with belongsTo/hasOne associations.
Although $results also doesn't contain associated records on first time,
it contains them on second time.
After 1fe943d6f1
,
it doesn't work if associated records are used in afterFind.
This commit fixes it.
2014-08-27 09:32:00 +09:00
Stefan Dickmann
66ccfaf5e2
session bugfix
2014-08-26 17:47:45 +02:00
mark_story
7936b5e764
Fix CURRENT_TIMESTAMP being stored as a default value.
...
When reflecting timestamp columns in MySQL current_timestamp comes back
as the default value. This causes insertion errors later on as
'current_timestamp' is an invalid value for timestamp columns.
Refs #4184
2014-08-25 11:17:11 +02:00
ADmad
9d53a1e9ce
Merge branch 'master' into 2.6
2014-08-15 12:37:13 +05:30
Brian Porter
5c69ac5578
All CakeSchema doc blocks conform to coding standards.
...
As laid out here: http://book.cakephp.org/2.0/en/contributing/cakephp-coding-conventions.html#typehinting
2014-08-12 12:55:55 -05:00
Brian Porter
4a0f42e179
Doc block capitalization corrections as requested.
2014-08-12 10:48:12 -05:00
Brian Porter
9b9600fe18
CakeSchema naming fallback.
...
Abstracts the `require_once` of the schema file so it can be done twice. The added second call is a fallback for the previous APP_DIR-based naming to provide backwards compatibility.
Removes now-obsolete CakeSchema tests that involved `Configure::read('App.dir')`. The CakeSchema::name is now always static (and predictable) in the default case.
2014-08-11 10:40:57 -05:00
Brian Porter
be9be48c46
More predictable default for CakeShema class naming.
...
Instead of using the `APP_DIR` constant, which may change between developer installations of a project and cause issues loading Schemas generated elsewhere, use a fixed string, 'App'.
This is related to CakeDC/migrations#184 and should fully resolve #4174 .
2014-08-11 09:12:16 -05:00
chinpei215
c246695518
Fix different format of $results in afterFind
...
Refs #2529
As of this commit, we can get consistent format of $resutls in afterFind.
And we can keep backward compatibility if Model::$useConsistentAfterFind is set to false.
2014-08-11 01:19:40 +09:00
chinpei215
c227c14bf2
Fix afterFind() called twice with hasMany relationship
...
It occurs when a model and the children models are related to a same model.
For example, such as the following:
* User hasMany Comment
* User hasMany Article
* Article hasMany Comment
2014-08-11 00:12:03 +09:00
mark_story
9c3089796f
Merge branch 'master' into 2.6
...
Conflicts:
lib/Cake/Model/Model.php
2014-08-08 23:28:06 -04:00
mark_story
d114fa1431
Update join building to not error out on empty conditions.
...
When conditions are empty we can assume one of two things:
* The person made a mistake.
* The person is doing the join conditions in the where clause.
In both cases we should attempt to generate proper SQL.
Fixes #4189
2014-08-08 10:02:09 -04:00
Mark S.
2471c64aae
Merge pull request #4158 from dereuromark/master-cakesession-hotfix
...
Fix notice in CakeSession.
2014-08-06 18:25:55 +02:00
José Lorenzo Rodríguez
64e74cbaac
Merge pull request #4175 from chinpei215/master-issue2268-fix
...
Fix afterFind() called twice with belongsTo and hasOne relationships
2014-08-06 10:48:45 +02:00
chinpei215
1fe943d6f1
Fix afterFind() called twice with belongsTo and hasOne relationships
...
Refs #2268
2014-08-06 07:27:04 +09:00
euromark
864f5e06f6
Fix notice in CakeSession.
2014-08-04 13:32:20 +02:00
chinpei215
cb376bf420
Add some more transaction tests
...
And remove 2 else clauses.
2014-08-03 22:34:11 +09:00
ADmad
713f430fc4
Merge branch 'master' into 2.6
2014-08-03 01:05:36 +05:30
chinpei215
799500ce6d
Fix transactions do not get rollbacked in saveAssociated/saveMany
...
Refs #2849
2014-08-02 10:12:33 +09:00
Anthony GRASSIOT
aa42b80a4d
a
/ an
typo fixes fot API
2014-07-30 22:11:03 +02:00
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