Commit graph

380 commits

Author SHA1 Message Date
nate
360b91eea7 Fixing HABTM associations on non-standard keys, fixes #4219, refactoring DboSource::calculate()
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6565 3807eeeb-6ff5-0310-8944-8be069107fe0
2008-03-13 03:11:29 +00:00
nate
c1c35b2e13 Refactoring DboSource - removes all SQL from Model, refactoring transaction handling
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6557 3807eeeb-6ff5-0310-8944-8be069107fe0
2008-03-11 02:44:33 +00:00
phpnut
5374807164 "Fixes #3846, Security blackhole when no radio selected
Fixes #3920, Multiple select w/ checkboxes issues warning when all are unselected
Fixes #3962, validation POST never pass when select multiple is submit
"

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6546 3807eeeb-6ff5-0310-8944-8be069107fe0
2008-03-10 00:25:59 +00:00
nate
9e37b6fc26 Adding test cases for saving hasMany associations with saveAll(), ref #4035
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6536 3807eeeb-6ff5-0310-8944-8be069107fe0
2008-03-09 07:59:23 +00:00
nate
e87d4e80dd Refactoring behavior method dispatch handling to work on PHP4, fixes #4296, refactoring schema test
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6532 3807eeeb-6ff5-0310-8944-8be069107fe0
2008-03-09 06:24:40 +00:00
nate
0ee0324e20 Improving validation support in Model::saveAll(), adding tests for cross-database joins, disproves #4251
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6511 3807eeeb-6ff5-0310-8944-8be069107fe0
2008-03-07 01:29:19 +00:00
nate
9fbf783286 Adding database prefix check in Model::setDataSource()
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6501 3807eeeb-6ff5-0310-8944-8be069107fe0
2008-03-01 20:30:01 +00:00
nate
5ce4469867 Adding fix for parenting issues in Tree behavior, fixes #4043, fixes #4037
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6500 3807eeeb-6ff5-0310-8944-8be069107fe0
2008-03-01 20:26:42 +00:00
nate
6546a39098 Updating Model::setDataSource(), table prefixes now switch when switching DataSource, unless a custom table prefix is set, fixes #4062
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6496 3807eeeb-6ff5-0310-8944-8be069107fe0
2008-03-01 05:15:53 +00:00
nate
e58c397bc9 Adding fix for loading join models classes from plugins, fixes #4014
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6493 3807eeeb-6ff5-0310-8944-8be069107fe0
2008-03-01 03:25:46 +00:00
nate
ab50975306 Correcting UPDATE query generation to support SQL standards and MySQL-specific features in parallel, fixes #4080
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6491 3807eeeb-6ff5-0310-8944-8be069107fe0
2008-03-01 03:12:12 +00:00
gwoo
1fbc3e6a9b quick fix for with and saveMulti
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6490 3807eeeb-6ff5-0310-8944-8be069107fe0
2008-02-29 22:01:09 +00:00
nate
c8ed9424da Fixing errors thrown in Model::exists() when $useTable is false
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6484 3807eeeb-6ff5-0310-8944-8be069107fe0
2008-02-28 04:35:20 +00:00
nate
97dded350f Returning default column type for models with no schema defined
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6482 3807eeeb-6ff5-0310-8944-8be069107fe0
2008-02-28 01:53:54 +00:00
nate
3a11fe2340 Refactoring find types in Model::find()
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6481 3807eeeb-6ff5-0310-8944-8be069107fe0
2008-02-28 01:50:38 +00:00
nate
3140144a1f Adding behavior test case and fixing validation behavior methods, fixes #4205
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6471 3807eeeb-6ff5-0310-8944-8be069107fe0
2008-02-24 02:47:10 +00:00
nate
0572926d49 Refactoring model behavior handling
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6469 3807eeeb-6ff5-0310-8944-8be069107fe0
2008-02-21 15:36:13 +00:00
nate
89052b0f54 Adding performance enhancement to Set::numeric(), adding $filterKey param to Model::create() to overwrite primary keys, closes #4046
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6438 3807eeeb-6ff5-0310-8944-8be069107fe0
2008-02-06 02:35:12 +00:00
nate
881cf3fc0a Adding foreign key check to Model::updateCounterCache(), fixes #4049
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6425 3807eeeb-6ff5-0310-8944-8be069107fe0
2008-02-02 04:50:44 +00:00
nate
7d39cad13f Updating docblocks
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6421 3807eeeb-6ff5-0310-8944-8be069107fe0
2008-02-01 02:03:04 +00:00
nate
18c2d9d446 Adding ModelBehavior::cleanup() callback for when behaviors are dynamically detached from models
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6420 3807eeeb-6ff5-0310-8944-8be069107fe0
2008-02-01 00:56:22 +00:00
nate
423a56c958 Adding Model::attach() and Model::detach() for dynamic loading/unloading of behaviors + tests, fixes #4010
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6415 3807eeeb-6ff5-0310-8944-8be069107fe0
2008-01-28 18:56:22 +00:00
nate
b9d3c4e2e8 Updating Model::saveAll(), adding tests. Fixes #3871
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6410 3807eeeb-6ff5-0310-8944-8be069107fe0
2008-01-27 01:57:39 +00:00
nate
943eaf7549 Refactoring DboSource::fields(), updating column type handling in DboSqlite, fixes #3944, using unquoted names to get column type in update queries, fixes #3917
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6398 3807eeeb-6ff5-0310-8944-8be069107fe0
2008-01-21 02:21:28 +00:00
nate
4c6bbaffff More Postgres abstraction/emulation fixes
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6387 3807eeeb-6ff5-0310-8944-8be069107fe0
2008-01-17 17:09:10 +00:00
phpnut
520d179850 "Fixes #3876, Associations do not work correctly in plugins"
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6382 3807eeeb-6ff5-0310-8944-8be069107fe0
2008-01-16 07:34:42 +00:00
nate
5e4a641003 Updating model test case and adding custom field support to Model::find('list'), closes #3802 (thanks GreyCells)
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6360 3807eeeb-6ff5-0310-8944-8be069107fe0
2008-01-11 03:16:19 +00:00
nate
aa7ca4e703 Updating docblocks of deprecated methods, closes #3819, closes #3878
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6357 3807eeeb-6ff5-0310-8944-8be069107fe0
2008-01-10 19:50:33 +00:00
nate
cbd715618b Removing MySQL-specific schema code from core, improving support for PostgreSQL sequences, most tests passing
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6355 3807eeeb-6ff5-0310-8944-8be069107fe0
2008-01-10 08:44:38 +00:00
phpnut
68487baf47 "Fixes #3854, Scaffolding is generating an id field with an empty value for auto_increment primary key"
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6345 3807eeeb-6ff5-0310-8944-8be069107fe0
2008-01-09 04:50:08 +00:00
phpnut
04934fdb2f Reverting [6249] and [6250] this commit broke the working implementation.
Closes #3810

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6344 3807eeeb-6ff5-0310-8944-8be069107fe0
2008-01-09 01:06:45 +00:00
nate
acd9cd5b8a Fixing return value in Model::saveAll(), fixes #3852
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6337 3807eeeb-6ff5-0310-8944-8be069107fe0
2008-01-08 10:21:25 +00:00
nate
b7abaf019c Adding non-null association key fix in Model, and updating Model::isUnique() to account for current record, fixes #3859, closes #2032
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6336 3807eeeb-6ff5-0310-8944-8be069107fe0
2008-01-08 06:29:51 +00:00
phpnut
83b6be9d60 "Correcting line changed in error"
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6319 3807eeeb-6ff5-0310-8944-8be069107fe0
2008-01-03 19:41:06 +00:00
phpnut
6dec91a89f "Fixes #3814, Bug in hasAndBelongsToMany"
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6317 3807eeeb-6ff5-0310-8944-8be069107fe0
2008-01-03 18:50:59 +00:00
nate
6191c58f69 Fixing after filters for Model::find('list'), fixes #3805
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6315 3807eeeb-6ff5-0310-8944-8be069107fe0
2008-01-02 23:07:54 +00:00
nate
7ea47e9893 Fixing Model::find('list') when using self-joins
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6304 3807eeeb-6ff5-0310-8944-8be069107fe0
2008-01-02 02:30:19 +00:00
nate
695ac50fd7 Adding full join model support, closes #828, closes #1845
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6299 3807eeeb-6ff5-0310-8944-8be069107fe0
2008-01-01 23:57:17 +00:00
phpnut
852fa4e921 "Closes #3653, Some optimization in code"
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6297 3807eeeb-6ff5-0310-8944-8be069107fe0
2008-01-01 22:28:47 +00:00
phpnut
cb53dc61b0 "Closes #2897, Built-in file validation.
Implemented Validation::extension(); and Vaidation::range();
Updated copyright notices in all files"

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6296 3807eeeb-6ff5-0310-8944-8be069107fe0
2008-01-01 22:18:17 +00:00
nate
5abe66289d Implemented 'counterCache' and 'counterScope' for belongsTo associations
Exempted 'created', 'updated' and 'modified' fields from whitelist when saving, closes #3720
Updated Model::bind(), closes #2355
Adding Model::saveAll() to save multiple records and associated records, closes #3615
Replacing Model::generateList() with Model::find('list'), deprecates Model::generateList()



git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6295 3807eeeb-6ff5-0310-8944-8be069107fe0
2008-01-01 19:34:40 +00:00
phpnut
43e05117fa "Closes #3602, Model beforeFilter API doc update"
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6294 3807eeeb-6ff5-0310-8944-8be069107fe0
2008-01-01 18:34:55 +00:00
phpnut
1aa2324e8e "Fixes #3786, Missing keys when Model merges actsAs.
Added additional test for Set::merge();
Refactored Controller::_mergeVars."

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6292 3807eeeb-6ff5-0310-8944-8be069107fe0
2008-01-01 01:07:24 +00:00
nate
72c80efa75 Fixes #3698, no additional select performed in Model::deleteAll() if $callbacks and $cascade are false
Fixes #2146, set 'foreignKey' => false and use association conditions to get custom join scoping
Fixes #3323, set 'foreignKey' => false to disable default conditions
Fixes #3627, added Model::$findQueryType to inform callbacks of the current find query type, i.e. 'count'


git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6258 3807eeeb-6ff5-0310-8944-8be069107fe0
2007-12-25 10:37:08 +00:00
phpnut
9c6f44006f "Closes #3012"
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6249 3807eeeb-6ff5-0310-8944-8be069107fe0
2007-12-25 07:59:13 +00:00
phpnut
3935746a29 "Refactored Model::invalidFields() to pass array(field => value) back to custom validation methods in a model
Closes #1863 postal code validation for Italy and Germany
Closes #2766, Add field name to params array for custom validation rules
Closes #3735, Custom validation functions
Commented out the failing model tests until the missing fixtures are added
"

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6243 3807eeeb-6ff5-0310-8944-8be069107fe0
2007-12-25 04:53:15 +00:00
nate
586e93f59f Adding 'last' validator option fix for Model::invalidFields()
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6240 3807eeeb-6ff5-0310-8944-8be069107fe0
2007-12-24 22:14:31 +00:00
nate
0d469ac4ba Fixing ability to specify select fields for join models, and adding tests
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6230 3807eeeb-6ff5-0310-8944-8be069107fe0
2007-12-23 17:03:19 +00:00
phpnut
4bad481735 "Fixes #3555, model::deleteAll gives sql error when retrieving id's (postgresql)"
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6214 3807eeeb-6ff5-0310-8944-8be069107fe0
2007-12-23 07:43:31 +00:00
phpnut
27721cb730 "Fixes #3726, Saving date, datetime, and time into database (form->input)"
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6210 3807eeeb-6ff5-0310-8944-8be069107fe0
2007-12-23 05:40:25 +00:00
phpnut
51baf42d62 "Changing Validation class to be a static class"
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6203 3807eeeb-6ff5-0310-8944-8be069107fe0
2007-12-22 21:03:30 +00:00
nate
c9f59b8713 Fixing LIMIT clause for Model::find('first') (Ticket #3754)
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6178 3807eeeb-6ff5-0310-8944-8be069107fe0
2007-12-20 14:36:39 +00:00
nate
cd8c26bda7 Allowing models to save empty records if they have a created, updated, or modified field (Ticket #3501)
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6173 3807eeeb-6ff5-0310-8944-8be069107fe0
2007-12-19 02:05:15 +00:00
phpnut
1e6665909b "Fixes #3101, Model::deconstruct() corrupting fields
Fixes #3726, Saving date, datetime, and time into database (form->input)"

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6148 3807eeeb-6ff5-0310-8944-8be069107fe0
2007-12-14 04:21:58 +00:00
nate
e6cceba47f Fixing warnings in Model::find('all') (Ticket #3712)
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6139 3807eeeb-6ff5-0310-8944-8be069107fe0
2007-12-10 03:28:21 +00:00
phpnut
8a2b51c3ec "Removing all shortcut function usage from the core"
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6128 3807eeeb-6ff5-0310-8944-8be069107fe0
2007-12-08 06:08:03 +00:00
nate
d9f713fefc Changing Model::$whitelist to filter fields in Model::save() instead of Model::set() (Ticket #3437)
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6120 3807eeeb-6ff5-0310-8944-8be069107fe0
2007-12-06 15:21:05 +00:00
phpnut
13bd58587a "Correcting undefined index notice"
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6117 3807eeeb-6ff5-0310-8944-8be069107fe0
2007-12-03 16:04:29 +00:00
phpnut
3a58f3cab6 "Fixes #3681, cascade has no effect"
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6112 3807eeeb-6ff5-0310-8944-8be069107fe0
2007-12-03 00:43:11 +00:00
phpnut
738449ee50 "Fixing Model::set() when null passed to first param, this was creating an empty keyed array"
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6102 3807eeeb-6ff5-0310-8944-8be069107fe0
2007-12-02 22:23:29 +00:00
nate
6a8c1474e0 Adding fix and updating test case for Model::find('count') (Ticket #3581)
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6100 3807eeeb-6ff5-0310-8944-8be069107fe0
2007-12-02 21:39:43 +00:00
gwoo
64e7390a6b updating model habtm saving, check against current hatbm aliases
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6099 3807eeeb-6ff5-0310-8944-8be069107fe0
2007-11-30 23:31:41 +00:00
phpnut
84b935506c "Fixing return of data from Model::save() when a behavior alters the data removing saved content"
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6095 3807eeeb-6ff5-0310-8944-8be069107fe0
2007-11-28 16:44:59 +00:00
nate
b2b654e7f5 Updating warning for Model::validates()
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6087 3807eeeb-6ff5-0310-8944-8be069107fe0
2007-11-26 19:48:46 +00:00
phpnut
c6f9c4bdb1 "Fixes #3589, Model::deconstruct() undefined index notice with $data['meridian']
Fixed loading of classes in Model test"

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6086 3807eeeb-6ff5-0310-8944-8be069107fe0
2007-11-26 18:00:06 +00:00
mariano.iglesias
085982c5f8 Adding propagation of $cascade parameter (indicating if dependent records will be deleted as well) to beforeDelete callback at the Model and Behavior level
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6074 3807eeeb-6ff5-0310-8944-8be069107fe0
2007-11-25 05:14:07 +00:00
phpnut
b0a1b18210 "Refactoring App class.
Added Configure::corePaths() to return paths to core library install.
Added additional tests for App::import()"

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6019 3807eeeb-6ff5-0310-8944-8be069107fe0
2007-11-18 07:18:25 +00:00
the_undefined
b3afc463ac Added a new $altKey parameter to normalizeFindParams
Refactored the unit test for it and added more samples

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6018 3807eeeb-6ff5-0310-8944-8be069107fe0
2007-11-18 06:14:27 +00:00
the_undefined
266d7ba738 Fixed test case for normalizeFindParams
Slightly refactored normalizeFindParams

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6017 3807eeeb-6ff5-0310-8944-8be069107fe0
2007-11-17 23:31:15 +00:00
nate
6f38be85f4 Laying groundwork for Model::find() refactor code
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6015 3807eeeb-6ff5-0310-8944-8be069107fe0
2007-11-17 22:46:55 +00:00
phpnut
f786c266c2 "Adding App::import for Overloadable class "
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6012 3807eeeb-6ff5-0310-8944-8be069107fe0
2007-11-17 17:35:47 +00:00
phpnut
c000940e36 Closes #2119 Only define clone() in PHP4 when it hasn't been already defined.
Closes #2213, Support multiple plugin paths.
Closes #2234, filepaths to behavior classes should be cached in class.paths.php also
Closes #2345, ability to group components into subfolders
Closes #2645, Improvement to basic.php for class loading.
Fixes #3526, Cache::write, when using just the config name, it fails.
Fixes #3559, loading plugin model as assoc don't work.
Closes #3567 Controller Folders (Note this does not need routing to work, but controller names can not conflict with others in the same application so naming must still be unique)
Fixes #3579, email.php component: Parse error with php 4.

Adding new class and file importer.
Updated most of the core to use the importer.
Added ClassRegsitry::init() that will create and instance of an object and store it in the registry.
Deprecated most of the load functions in basics.php
Plugin model loading now forces using the dot notation, to use models within a plugin, all the model associations must be in the PluginName.Model syntax, if this is not used, the plugin will look for the models in the main app/models directory first, if not found then it will search the plugin directories recursively until it finds a model.
	var $belongsTo = array('SomeModel'); will look for some_model.php in the app/models
	var $belongsTo = array('MyPlugin.SomeModel'); will look for some_model.php in my_plugin/models
	var $belongsTo = array('MyPlugin.MyPlugin', 'SomeModel'); will used my_plugin/models/my_plugin.php and app/models/some_model.php
	
The controllers of the plugin will still look for the default models inside the plugin if var $uses is not set:
	var $uses = array('SomeModel'); will look for some_model.php in the app/models
	var $uses = array('MyPlugin.SomeModel'); will look for some_model.php in my_plugin/models
	var $uses = array('MyPlugin.MyPlugin', 'SomeModel'); will used my_plugin/models/my_plugin.php and app/models/some_model.php

All of the above will work between plugins and main app
These changes also allow placing model and controllers is sub directories
Removed old class.paths.php file generation 

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6001 3807eeeb-6ff5-0310-8944-8be069107fe0
2007-11-16 09:35:19 +00:00
nate
858447a184 Fixing date/time inputs and removing dependency on Controller::cleanUpFields()
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@5965 3807eeeb-6ff5-0310-8944-8be069107fe0
2007-11-08 00:05:12 +00:00
mariano.iglesias
53052452f7 Adding documentation for Model
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@5949 3807eeeb-6ff5-0310-8944-8be069107fe0
2007-11-05 03:36:12 +00:00
the_undefined
7e57a4d28b Updated return value docblock for Model::save
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@5941 3807eeeb-6ff5-0310-8944-8be069107fe0
2007-11-03 17:55:30 +00:00
phpnut
6ab2b013bc Initial refactoring of scaffold and bake.
Removing unused vars

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@5917 3807eeeb-6ff5-0310-8944-8be069107fe0
2007-10-29 03:04:08 +00:00
nate
8f12e402df Fixing ACL test, misc ACL lookup optimizations
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@5916 3807eeeb-6ff5-0310-8944-8be069107fe0
2007-10-29 00:17:37 +00:00
gwoo
fbd3811cd1 removing usage of Model::loadInfo() replaced by Model::schema(), removing new lines at the end of some files, removed deprecated chmodr() function from basics, updated bake and scaffold views
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@5912 3807eeeb-6ff5-0310-8944-8be069107fe0
2007-10-28 04:18:18 +00:00
phpnut
19d99d13a0 Removing unneeded code in model::__generateAssociation();
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@5906 3807eeeb-6ff5-0310-8944-8be069107fe0
2007-10-27 05:29:11 +00:00
phpnut
f41aa80b78 Removing vars that are no longer used.
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@5904 3807eeeb-6ff5-0310-8944-8be069107fe0
2007-10-27 01:32:17 +00:00
phpnut
8d6599c34b Fixing bug for related records not being returned when using $recursive > 1.
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@5902 3807eeeb-6ff5-0310-8944-8be069107fe0
2007-10-26 08:40:10 +00:00
phpnut
f57fc45d6f Fixes #3455, Secondary model array in model data causes corruption
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@5898 3807eeeb-6ff5-0310-8944-8be069107fe0
2007-10-25 02:53:54 +00:00
phpnut
06b7a1cc05 Fixing return of $success in Model::save()
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@5895 3807eeeb-6ff5-0310-8944-8be069107fe0
2007-10-24 18:53:25 +00:00
phpnut
353eab91d5 Adding fix for lost data in Model::afterSave();
Closes #2465, Model::save(); now returns the values of $this->data after a successful save;

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@5894 3807eeeb-6ff5-0310-8944-8be069107fe0
2007-10-24 17:44:27 +00:00
nate
076f780ed6 Updating Model::findNeighbours() to allow array conditions and field lists (Ticket #1176 and Ticket #3231)
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@5880 3807eeeb-6ff5-0310-8944-8be069107fe0
2007-10-23 13:41:25 +00:00
phpnut
cb6a38abaf Fixes #3430, Query broken when model having associations linked to model has same alias to a different model
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@5871 3807eeeb-6ff5-0310-8944-8be069107fe0
2007-10-22 22:58:38 +00:00
mariano.iglesias
896f62544b Changing @return int to @return integer and @param bool to @param boolean
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@5860 3807eeeb-6ff5-0310-8944-8be069107fe0
2007-10-22 16:54:36 +00:00
phpnut
160cd28440 Correcting @return int
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@5858 3807eeeb-6ff5-0310-8944-8be069107fe0
2007-10-22 16:11:12 +00:00
phpnut
da97a5c871 Correcting @return bool
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@5857 3807eeeb-6ff5-0310-8944-8be069107fe0
2007-10-22 16:09:35 +00:00
mariano.iglesias
897825d596 Adding documentation to classes belonging to Cake console.
Standarizing on datatypes used in phpdocblocs and removing unneeded @return types

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@5851 3807eeeb-6ff5-0310-8944-8be069107fe0
2007-10-22 05:52:20 +00:00
phpnut
7ca924d661 Closes #3362, Changed self associated models so they no longer reference the single instance of the original model.
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@5845 3807eeeb-6ff5-0310-8944-8be069107fe0
2007-10-22 02:11:58 +00:00
nate
c8b6269a64 Refactoring find*() methods into Model::find(), i.e. Model::find('all', array('conditions' => ...)), findCount()/find('count') results are no longer filtered
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@5834 3807eeeb-6ff5-0310-8944-8be069107fe0
2007-10-21 18:34:23 +00:00
phpnut
d923ffbd94 Reverting changes made to model.test.php in [5822]
Reverting changes made to model.php in [5815]

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@5827 3807eeeb-6ff5-0310-8944-8be069107fe0
2007-10-21 03:44:26 +00:00
nate
bc28d91b40 Changing Model::hasAny() to not query associations (Ticket #2816)
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@5825 3807eeeb-6ff5-0310-8944-8be069107fe0
2007-10-21 03:32:23 +00:00
phpnut
e750c9d38f Closes #3318, When model calls invalidate, it would be usefull to use the __(messageID, true)
Fixes #2603, Scaffold edit() should redirect to index() when no record is found.
Closes #2990 cake_sessions Needs A Database Name Setting, Configure::write('Session.database', 'default')
Closes #3120, database - $config['encoding']; added new settings to database.php.default
Corrected errors when setting database configurations from console, would not allow changing setting on old configuration.

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@5815 3807eeeb-6ff5-0310-8944-8be069107fe0
2007-10-20 10:14:30 +00:00
phpnut
5cb63a6460 Fixes #3418, Model throws warnings when trying to save an empty array
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@5804 3807eeeb-6ff5-0310-8944-8be069107fe0
2007-10-19 21:05:34 +00:00
phpnut
34380bf243 Fixes #3411, failing test when $data has more than one models data.
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@5789 3807eeeb-6ff5-0310-8944-8be069107fe0
2007-10-19 03:33:19 +00:00
phpnut
a207a95893 Fixes #3187 and #3230, Model -> save issue with fieldList and id
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@5781 3807eeeb-6ff5-0310-8944-8be069107fe0
2007-10-17 21:19:30 +00:00
phpnut
998ee569e7 Fixes #2902, DB_ACL::allow allowing all when $actions is not an array.
Fixes #2988, AclComponent check() does not inherit permissions.
Fixes #3022, Inconsistent table alias quoting crashes Acl node lookup with PostgreSQL.
Fixes #3129, Console ACL Shell ACO View Broken
Fixes #3176, Problems with ACL support on Microsoft SQL Server.
Closes #3311 as invalid, DboSourceTest::testArrayConditionsParsing tests added 
Fixes #3312, DB_ACL::check() fail returning right permission
Fixes #3344, Model->field adds incorrect condition under certain circumstances.
Fixes #3400, Cookie Component: When reading a non-existing key it throws a notice.
Fixes #3407, Since [5768] CookieComponent throws warning when used in beforeFilter().
Closes #3401, Added form test to ensure $Form->fields array is what the security component requires.
Updated AclComponentTest
Merged changes in app/ to cake/console/libs/templates/skel
Fixed generated link to Run More Test after running Group > All tests


git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@5776 3807eeeb-6ff5-0310-8944-8be069107fe0
2007-10-17 12:51:17 +00:00
gwoo
68c63b67f3 model and db_config task fixes
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@5760 3807eeeb-6ff5-0310-8944-8be069107fe0
2007-10-15 07:48:19 +00:00
gwoo
356fd587cd updating exists, fixes #3368, test added. thank you maular
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@5733 3807eeeb-6ff5-0310-8944-8be069107fe0
2007-10-08 17:43:14 +00:00
phpnut
e085cc9a27 Fixes #3357, setSource not working
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@5728 3807eeeb-6ff5-0310-8944-8be069107fe0
2007-10-06 05:31:46 +00:00
gwoo
2ef118c3c4 replacing define CACHE_CHECK with Configure Cache.check, updating Model::exists()
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@5707 3807eeeb-6ff5-0310-8944-8be069107fe0
2007-10-01 16:49:37 +00:00
gwoo
908f4c8a39 defining $fields in Model::loadInfo()
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@5699 3807eeeb-6ff5-0310-8944-8be069107fe0
2007-09-28 10:04:25 +00:00
phpnut
dc76d14191 Correcting Model::invalidFields() isset would return false if $data[$fieldName] had been set to null, fixes issues with validating fields if their value had been set to null.
Merged changes from app to skel

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@5677 3807eeeb-6ff5-0310-8944-8be069107fe0
2007-09-20 22:45:00 +00:00
nate
09e64d075f Implementing beforeValidate() behavior callback (Ticket #2818), and allowing $actsAs to be specified in AppModel
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@5676 3807eeeb-6ff5-0310-8944-8be069107fe0
2007-09-20 15:16:25 +00:00
nate
1791a378c0 Allowing behavior methods to be used in model validation (Ticket #3178)
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@5651 3807eeeb-6ff5-0310-8944-8be069107fe0
2007-09-16 18:18:23 +00:00
mariano.iglesias
f433768806 Fixing double return
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@5633 3807eeeb-6ff5-0310-8944-8be069107fe0
2007-09-14 01:08:11 +00:00
phpnut
fdc575b107 Fixes #3140, UUID char(36) primary key double insert bug
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@5625 3807eeeb-6ff5-0310-8944-8be069107fe0
2007-09-10 12:06:53 +00:00
phpnut
77a9e3dd22 Fixing fixtures.
Fixing setting of primaryKey when a model HABTM association is defined

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@5614 3807eeeb-6ff5-0310-8944-8be069107fe0
2007-09-03 04:48:58 +00:00
phpnut
f1de783295 Fixing bug when instances of an HABTM association was automatically created.
Deprecated using $this->(ModelName) if an associations is created with an alias.

 
 	example with alias: var $hasMany = array('Assoc' => array('className' => 'ModelName'));
 					correct usage: $this->Assoc->modelMethods();

  	example without alias: var $hasMany = array('ModelName');
 					correct usage: $this->ModelName->modelMethods();

Fixed instances of 'className' that was still used in the core.

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@5608 3807eeeb-6ff5-0310-8944-8be069107fe0
2007-08-29 20:47:03 +00:00
phpnut
d20ddfeadc Refactoring automatic model creations for HABTM associations
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@5606 3807eeeb-6ff5-0310-8944-8be069107fe0
2007-08-29 10:14:14 +00:00
phpnut
49275b8aee Merging recent changes in 1.2 datasources into 1.1
Refactored Model::setSource() to remove unneeded code

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@5596 3807eeeb-6ff5-0310-8944-8be069107fe0
2007-08-29 00:16:13 +00:00
phpnut
0161f4f6d7 Fixes #3118 Prefix in models : can't use allow empty tablePrefix with a prefix defined in DATABASE_CONFIG
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@5593 3807eeeb-6ff5-0310-8944-8be069107fe0
2007-08-28 21:44:47 +00:00
gwoo
8bb67d9f6a Adding Schema support, updated fixtures, deprecated loadInfo, changed Dbo::describe in all dbos, fixed tests,
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@5563 3807eeeb-6ff5-0310-8944-8be069107fe0
2007-08-21 21:46:59 +00:00
phpnut
eeeee7b49b Implementing automatic UUID for primary keys if the field is CHAR(36).
Stripped out old code from NeatString.
Added String:uuid();
Renamed neat_string.test.php.
Added test for UUID generation.

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@5552 3807eeeb-6ff5-0310-8944-8be069107fe0
2007-08-20 01:58:44 +00:00
nate
c3dc8cb827 Implementing automatic join models for HABTM associations, adding table prefix fix for Ticket #1965
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@5522 3807eeeb-6ff5-0310-8944-8be069107fe0
2007-08-14 23:12:24 +00:00
nate
1a690c48a4 Adding dynamic model creation to Model::__construct()
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@5488 3807eeeb-6ff5-0310-8944-8be069107fe0
2007-08-04 17:20:50 +00:00
gwoo
d98ce2d5a3 changing findCount to return intval, #3009.
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@5487 3807eeeb-6ff5-0310-8944-8be069107fe0
2007-08-04 16:13:48 +00:00
phpnut
549d86ac23 Refactoring dispatcher.
Added test for changes to Dispatcher.
Updating Model::_ _saveMulti(), moved the insert statement to DboSource::insertMulti() this will allow database that do not support multiple inserts in one statement to save data.


git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@5460 3807eeeb-6ff5-0310-8944-8be069107fe0
2007-07-25 04:38:28 +00:00
phpnut
cedf6993b2 Adding fix for #2869, fixes count function not escaping "count" properly in pgsql
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@5384 3807eeeb-6ff5-0310-8944-8be069107fe0
2007-07-06 17:19:59 +00:00
phpnut
3880f9ce13 Refactoring Set::reverse() and Model::set()
Set::reverse() will now reverse the object to an array that was created in Set::map();
Added testMapReverse() to Set tests.
Removed code in Model::set() that was no longer needed

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@5373 3807eeeb-6ff5-0310-8944-8be069107fe0
2007-07-02 18:36:49 +00:00
mariano.iglesias
cd09a7c7dd Adding option to group elements in Set::combine and making Model::generateList use Set::combine. Adding tests for Model::generateList and more tests for Set::combine
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@5370 3807eeeb-6ff5-0310-8944-8be069107fe0
2007-07-01 03:43:05 +00:00
phpnut
5e2b574e2f Refactoring Model::set()
Added Set::reverse(0 to convert an object to an array

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@5368 3807eeeb-6ff5-0310-8944-8be069107fe0
2007-06-30 06:52:39 +00:00
mariano.iglesias
da2988a22b Improving HABTM saving by getting rid of unneeded loop and escaping field names
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@5367 3807eeeb-6ff5-0310-8944-8be069107fe0
2007-06-28 17:31:26 +00:00
phpnut
2e54eb1706 Refactoring the Model::_ _saveMulti() to use one INSERT statement instead of looping over each value and querying INSERT.
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@5366 3807eeeb-6ff5-0310-8944-8be069107fe0
2007-06-28 06:46:26 +00:00
phpnut
2da6ed2d7a Adding enhancement to allow saving habtm data without needing to update or save a parent record
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@5363 3807eeeb-6ff5-0310-8944-8be069107fe0
2007-06-28 02:47:16 +00:00
nate
588ab18197 Adding aliasing fix for DboSource::delete() and Model::deleteAll() (Ticket #2735)
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@5361 3807eeeb-6ff5-0310-8944-8be069107fe0
2007-06-27 19:13:44 +00:00
phpnut
3f25e0c44d Adding DboSource::value() to findCount() to wrap the count in dbo specific quoting
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@5350 3807eeeb-6ff5-0310-8944-8be069107fe0
2007-06-26 19:02:10 +00:00
phpnut
b7ba57c8b1 Fixing TreeBehavior so tests will work on php 4.
Removing _ _METHOD_ _ from files since it is not valid on php 4

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@5337 3807eeeb-6ff5-0310-8944-8be069107fe0
2007-06-23 04:16:33 +00:00
phpnut
cbbf006bd6 Adding fix for:
Ticket #1303, fixes On HABTM save() the associated field 'id' must be first in $this->params
Ticket #1819, fixes save() for HABTM to allow array keys in any order.
Ticket #2762, fixes Model::save() for HABTM not saving if no data from the parent Model is present

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@5320 3807eeeb-6ff5-0310-8944-8be069107fe0
2007-06-21 13:53:51 +00:00
phpnut
dac1bd0913 Correcting code structure to standards
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@5315 3807eeeb-6ff5-0310-8944-8be069107fe0
2007-06-20 07:51:52 +00:00
phpnut
23dfd90b29 Correcting code structure to standards
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@5313 3807eeeb-6ff5-0310-8944-8be069107fe0
2007-06-20 06:15:35 +00:00
phpnut
b9f56fb0a7 Adding fix for Ticket #2799, default error message should be i18n
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@5309 3807eeeb-6ff5-0310-8944-8be069107fe0
2007-06-20 03:47:31 +00:00
gwoo
dad80d947d changing Model::create to use Set::filter
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@5272 3807eeeb-6ff5-0310-8944-8be069107fe0
2007-06-10 17:41:35 +00:00
gwoo
95bb7e0f04 updating bake view templates
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@5266 3807eeeb-6ff5-0310-8944-8be069107fe0
2007-06-08 16:30:22 +00:00
phpnut
52680ffcd3 Adding fix for FormHelper::checkbox() not creating the hidden fields.
Corrected errors when multiple hidden fields used in a form.
Fixed SecurityComponent::_ _validatePost() that would invalidate a form when checkboxes used.


git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@5238 3807eeeb-6ff5-0310-8944-8be069107fe0
2007-06-04 06:11:48 +00:00
phpnut
dcad548cac Adding fix for #2587, _ _backAssociation as real class member
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@5125 3807eeeb-6ff5-0310-8944-8be069107fe0
2007-05-20 05:05:18 +00:00
mariano.iglesias
9b5dc57881 Fixing support for error messages when multiple validation rules are used with numeric indexes
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@5093 3807eeeb-6ff5-0310-8944-8be069107fe0
2007-05-14 10:37:23 +00:00
gwoo
51e78eac9f updating model constructor in 1.1, 1.2 to use the $table param
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@5067 3807eeeb-6ff5-0310-8944-8be069107fe0
2007-05-13 01:09:40 +00:00
phpnut
c4f8a836e5 Adding fix for #2547, fixes issue when saving arrays with numeric keys
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@5041 3807eeeb-6ff5-0310-8944-8be069107fe0
2007-05-12 05:20:40 +00:00
nate
360690ed7f Adding sanity checking / warning messages for data returned from Model::loadInfo() (thanks phishy)
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@5027 3807eeeb-6ff5-0310-8944-8be069107fe0
2007-05-05 17:36:30 +00:00
phpnut
b42e908656 Adding patch from #2528, fixes validation passing when even when allowEmpty === false
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@5010 3807eeeb-6ff5-0310-8944-8be069107fe0
2007-05-04 07:13:15 +00:00
phpnut
0bdb6d7e1d Adding fix for #2522, fixes errors when primary key is not auto increment and the primary key is set in the data to be saved.
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@4995 3807eeeb-6ff5-0310-8944-8be069107fe0
2007-05-03 12:08:28 +00:00
phpnut
137fea94c6 Cleaning up line endings
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@4994 3807eeeb-6ff5-0310-8944-8be069107fe0
2007-05-03 04:35:25 +00:00
mariano.iglesias
8982d82c0d Adding option to send extra parameters to a custom validation and more tests for validation
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@4980 3807eeeb-6ff5-0310-8944-8be069107fe0
2007-05-02 07:48:22 +00:00
phpnut
5cd13cff26 Adding additional tests for validation.
Added fix to model to pass the new tests

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@4970 3807eeeb-6ff5-0310-8944-8be069107fe0
2007-05-01 10:30:36 +00:00
phpnut
767853afae Adding fix for failing model validation tests
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@4967 3807eeeb-6ff5-0310-8944-8be069107fe0
2007-05-01 03:52:28 +00:00
phpnut
0fc3cd00d3 Adding fix for #2505
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@4956 3807eeeb-6ff5-0310-8944-8be069107fe0
2007-05-01 00:19:42 +00:00
phpnut
2dd02aafba Fixing overriding of default messages
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@4949 3807eeeb-6ff5-0310-8944-8be069107fe0
2007-04-30 12:18:09 +00:00