2008-05-30 11:40:08 +00:00
|
|
|
<?php
|
|
|
|
/**
|
2009-03-18 17:55:58 +00:00
|
|
|
* Mock models file
|
2008-05-30 11:40:08 +00:00
|
|
|
*
|
|
|
|
* Mock classes for use in Model and related test cases
|
|
|
|
*
|
|
|
|
* PHP versions 4 and 5
|
|
|
|
*
|
2010-05-19 01:15:13 +00:00
|
|
|
* CakePHP(tm) Tests <http://book.cakephp.org/view/1196/Testing>
|
2010-01-26 19:18:20 +00:00
|
|
|
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
2008-05-30 11:40:08 +00:00
|
|
|
*
|
|
|
|
* Licensed under The Open Group Test Suite License
|
|
|
|
* Redistributions of files must retain the above copyright notice.
|
|
|
|
*
|
2010-01-26 19:18:20 +00:00
|
|
|
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
2010-05-19 01:15:13 +00:00
|
|
|
* @link http://book.cakephp.org/view/1196/Testing CakePHP(tm) Tests
|
2009-03-18 17:55:58 +00:00
|
|
|
* @package cake
|
2008-10-30 17:30:26 +00:00
|
|
|
* @subpackage cake.tests.cases.libs.model
|
|
|
|
* @since CakePHP(tm) v 1.2.0.6464
|
|
|
|
* @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License
|
2008-05-30 11:40:08 +00:00
|
|
|
*/
|
|
|
|
if (!defined('CAKEPHP_UNIT_TEST_EXECUTION')) {
|
|
|
|
define('CAKEPHP_UNIT_TEST_EXECUTION', 1);
|
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-05-30 11:40:08 +00:00
|
|
|
/**
|
2008-08-05 03:22:25 +00:00
|
|
|
* Test class
|
2008-05-30 11:40:08 +00:00
|
|
|
*
|
2009-03-18 17:55:58 +00:00
|
|
|
* @package cake
|
2008-10-30 17:30:26 +00:00
|
|
|
* @subpackage cake.tests.cases.libs.model
|
2008-05-30 11:40:08 +00:00
|
|
|
*/
|
2008-08-05 03:22:25 +00:00
|
|
|
class Test extends CakeTestModel {
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-02 19:22:55 +00:00
|
|
|
/**
|
|
|
|
* useTable property
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2008-06-02 19:22:55 +00:00
|
|
|
* @var bool false
|
|
|
|
* @access public
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
var $useTable = false;
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-02 19:22:55 +00:00
|
|
|
/**
|
|
|
|
* name property
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2008-06-02 19:22:55 +00:00
|
|
|
* @var string 'Test'
|
|
|
|
* @access public
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
var $name = 'Test';
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-02 19:22:55 +00:00
|
|
|
/**
|
|
|
|
* schema property
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2008-06-02 19:22:55 +00:00
|
|
|
* @var array
|
|
|
|
* @access protected
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
var $_schema = array(
|
|
|
|
'id'=> array('type' => 'integer', 'null' => '', 'default' => '1', 'length' => '8', 'key'=>'primary'),
|
|
|
|
'name'=> array('type' => 'string', 'null' => '', 'default' => '', 'length' => '255'),
|
|
|
|
'email'=> array('type' => 'string', 'null' => '1', 'default' => '', 'length' => '155'),
|
|
|
|
'notes'=> array('type' => 'text', 'null' => '1', 'default' => 'write some notes here', 'length' => ''),
|
|
|
|
'created'=> array('type' => 'date', 'null' => '1', 'default' => '', 'length' => ''),
|
|
|
|
'updated'=> array('type' => 'datetime', 'null' => '1', 'default' => '', 'length' => null)
|
|
|
|
);
|
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-16 03:11:32 +00:00
|
|
|
/**
|
2008-08-05 03:22:25 +00:00
|
|
|
* TestAlias class
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2009-03-18 17:55:58 +00:00
|
|
|
* @package cake
|
2008-10-30 17:30:26 +00:00
|
|
|
* @subpackage cake.tests.cases.libs.model
|
2008-06-16 03:11:32 +00:00
|
|
|
*/
|
2008-08-05 03:22:25 +00:00
|
|
|
class TestAlias extends CakeTestModel {
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-05 15:20:45 +00:00
|
|
|
/**
|
|
|
|
* useTable property
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2008-06-05 15:20:45 +00:00
|
|
|
* @var bool false
|
|
|
|
* @access public
|
|
|
|
*/
|
2008-06-20 20:17:23 +00:00
|
|
|
var $useTable = false;
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-05 15:20:45 +00:00
|
|
|
/**
|
|
|
|
* name property
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2008-06-05 15:20:45 +00:00
|
|
|
* @var string 'TestAlias'
|
|
|
|
* @access public
|
|
|
|
*/
|
2008-06-20 20:17:23 +00:00
|
|
|
var $name = 'TestAlias';
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-02 19:22:55 +00:00
|
|
|
/**
|
|
|
|
* alias property
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2008-06-02 19:22:55 +00:00
|
|
|
* @var string 'TestAlias'
|
|
|
|
* @access public
|
|
|
|
*/
|
2008-06-20 20:17:23 +00:00
|
|
|
var $alias = 'TestAlias';
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-02 19:22:55 +00:00
|
|
|
/**
|
|
|
|
* schema property
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2008-06-02 19:22:55 +00:00
|
|
|
* @var array
|
|
|
|
* @access protected
|
|
|
|
*/
|
2008-06-20 20:17:23 +00:00
|
|
|
var $_schema = array(
|
2008-06-16 03:11:32 +00:00
|
|
|
'id'=> array('type' => 'integer', 'null' => '', 'default' => '1', 'length' => '8', 'key'=>'primary'),
|
|
|
|
'name'=> array('type' => 'string', 'null' => '', 'default' => '', 'length' => '255'),
|
|
|
|
'email'=> array('type' => 'string', 'null' => '1', 'default' => '', 'length' => '155'),
|
|
|
|
'notes'=> array('type' => 'text', 'null' => '1', 'default' => 'write some notes here', 'length' => ''),
|
|
|
|
'created'=> array('type' => 'date', 'null' => '1', 'default' => '', 'length' => ''),
|
|
|
|
'updated'=> array('type' => 'datetime', 'null' => '1', 'default' => '', 'length' => null)
|
2008-05-30 11:40:08 +00:00
|
|
|
);
|
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-05-30 11:40:08 +00:00
|
|
|
/**
|
2008-08-05 03:22:25 +00:00
|
|
|
* TestValidate class
|
2008-05-30 11:40:08 +00:00
|
|
|
*
|
2009-03-18 17:55:58 +00:00
|
|
|
* @package cake
|
2008-10-30 17:30:26 +00:00
|
|
|
* @subpackage cake.tests.cases.libs.model
|
2008-05-30 11:40:08 +00:00
|
|
|
*/
|
2008-08-05 03:22:25 +00:00
|
|
|
class TestValidate extends CakeTestModel {
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-02 19:22:55 +00:00
|
|
|
/**
|
|
|
|
* useTable property
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2008-06-02 19:22:55 +00:00
|
|
|
* @var bool false
|
|
|
|
* @access public
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
var $useTable = false;
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-02 19:22:55 +00:00
|
|
|
/**
|
|
|
|
* name property
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2008-06-02 19:22:55 +00:00
|
|
|
* @var string 'TestValidate'
|
|
|
|
* @access public
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
var $name = 'TestValidate';
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-02 19:22:55 +00:00
|
|
|
/**
|
|
|
|
* schema property
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2008-06-02 19:22:55 +00:00
|
|
|
* @var array
|
|
|
|
* @access protected
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
var $_schema = array(
|
|
|
|
'id' => array('type' => 'integer', 'null' => '', 'default' => '', 'length' => '8'),
|
|
|
|
'title' => array('type' => 'string', 'null' => '', 'default' => '', 'length' => '255'),
|
|
|
|
'body' => array('type' => 'string', 'null' => '1', 'default' => '', 'length' => ''),
|
|
|
|
'number' => array('type' => 'integer', 'null' => '', 'default' => '', 'length' => '8'),
|
|
|
|
'created' => array('type' => 'date', 'null' => '1', 'default' => '', 'length' => ''),
|
|
|
|
'modified' => array('type' => 'datetime', 'null' => '1', 'default' => '', 'length' => null)
|
|
|
|
);
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-02 19:22:55 +00:00
|
|
|
/**
|
|
|
|
* validateNumber method
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
|
|
|
* @param mixed $value
|
|
|
|
* @param mixed $options
|
2008-06-02 19:22:55 +00:00
|
|
|
* @access public
|
|
|
|
* @return void
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
function validateNumber($value, $options) {
|
|
|
|
$options = array_merge(array('min' => 0, 'max' => 100), $options);
|
|
|
|
$valid = ($value['number'] >= $options['min'] && $value['number'] <= $options['max']);
|
|
|
|
return $valid;
|
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-02 19:22:55 +00:00
|
|
|
/**
|
|
|
|
* validateTitle method
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
|
|
|
* @param mixed $value
|
2008-06-02 19:22:55 +00:00
|
|
|
* @access public
|
|
|
|
* @return void
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
function validateTitle($value) {
|
|
|
|
return (!empty($value) && strpos(low($value['title']), 'title-') === 0);
|
|
|
|
}
|
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-05-30 11:40:08 +00:00
|
|
|
/**
|
2008-08-05 03:22:25 +00:00
|
|
|
* User class
|
2008-05-30 11:40:08 +00:00
|
|
|
*
|
2009-03-18 17:55:58 +00:00
|
|
|
* @package cake
|
2008-10-30 17:30:26 +00:00
|
|
|
* @subpackage cake.tests.cases.libs.model
|
2008-05-30 11:40:08 +00:00
|
|
|
*/
|
|
|
|
class User extends CakeTestModel {
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-02 19:22:55 +00:00
|
|
|
/**
|
|
|
|
* name property
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2008-06-02 19:22:55 +00:00
|
|
|
* @var string 'User'
|
|
|
|
* @access public
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
var $name = 'User';
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-02 19:22:55 +00:00
|
|
|
/**
|
|
|
|
* validate property
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2008-06-02 19:22:55 +00:00
|
|
|
* @var array
|
|
|
|
* @access public
|
|
|
|
*/
|
2009-01-15 01:55:31 +00:00
|
|
|
var $validate = array('user' => 'notEmpty', 'password' => 'notEmpty');
|
2008-05-30 11:40:08 +00:00
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-05-30 11:40:08 +00:00
|
|
|
/**
|
2008-09-25 00:58:06 +00:00
|
|
|
* Article class
|
2008-05-30 11:40:08 +00:00
|
|
|
*
|
2009-03-18 17:55:58 +00:00
|
|
|
* @package cake
|
2008-10-30 17:30:26 +00:00
|
|
|
* @subpackage cake.tests.cases.libs.model
|
2008-05-30 11:40:08 +00:00
|
|
|
*/
|
|
|
|
class Article extends CakeTestModel {
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-02 19:22:55 +00:00
|
|
|
/**
|
|
|
|
* name property
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2008-06-02 19:22:55 +00:00
|
|
|
* @var string 'Article'
|
|
|
|
* @access public
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
var $name = 'Article';
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-02 19:22:55 +00:00
|
|
|
/**
|
|
|
|
* belongsTo property
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2008-06-02 19:22:55 +00:00
|
|
|
* @var array
|
|
|
|
* @access public
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
var $belongsTo = array('User');
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-02 19:22:55 +00:00
|
|
|
/**
|
|
|
|
* hasMany property
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2008-06-02 19:22:55 +00:00
|
|
|
* @var array
|
|
|
|
* @access public
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
var $hasMany = array('Comment' => array('dependent' => true));
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-02 19:22:55 +00:00
|
|
|
/**
|
|
|
|
* hasAndBelongsToMany property
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2008-06-02 19:22:55 +00:00
|
|
|
* @var array
|
|
|
|
* @access public
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
var $hasAndBelongsToMany = array('Tag');
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-02 19:22:55 +00:00
|
|
|
/**
|
|
|
|
* validate property
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2008-06-02 19:22:55 +00:00
|
|
|
* @var array
|
|
|
|
* @access public
|
|
|
|
*/
|
2009-01-15 01:55:31 +00:00
|
|
|
var $validate = array('user_id' => 'numeric', 'title' => array('allowEmpty' => false, 'rule' => 'notEmpty'), 'body' => 'notEmpty');
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-02 19:22:55 +00:00
|
|
|
/**
|
|
|
|
* beforeSaveReturn property
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2008-06-02 19:22:55 +00:00
|
|
|
* @var bool true
|
|
|
|
* @access public
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
var $beforeSaveReturn = true;
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-02 19:22:55 +00:00
|
|
|
/**
|
|
|
|
* beforeSave method
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2008-06-02 19:22:55 +00:00
|
|
|
* @access public
|
|
|
|
* @return void
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
function beforeSave() {
|
|
|
|
return $this->beforeSaveReturn;
|
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-02 19:22:55 +00:00
|
|
|
/**
|
|
|
|
* titleDuplicate method
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
|
|
|
* @param mixed $title
|
2008-06-02 19:22:55 +00:00
|
|
|
* @access public
|
|
|
|
* @return void
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
function titleDuplicate ($title) {
|
|
|
|
if ($title === 'My Article Title') {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2010-09-29 02:26:54 +00:00
|
|
|
/**
|
|
|
|
* Model stub for beforeDelete testing
|
|
|
|
*
|
|
|
|
* @see #250
|
|
|
|
* @package cake.tests
|
|
|
|
*/
|
|
|
|
class BeforeDeleteComment extends CakeTestModel {
|
|
|
|
var $name = 'BeforeDeleteComment';
|
2010-11-03 13:25:42 +00:00
|
|
|
|
2010-09-29 02:26:54 +00:00
|
|
|
var $useTable = 'comments';
|
|
|
|
|
|
|
|
function beforeDelete($cascade = true) {
|
|
|
|
$db =& $this->getDataSource();
|
|
|
|
$db->delete($this, array($this->alias . '.' . $this->primaryKey => array(1, 3)));
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-05-30 11:40:08 +00:00
|
|
|
/**
|
2008-08-05 03:22:25 +00:00
|
|
|
* NumericArticle class
|
2008-05-30 11:40:08 +00:00
|
|
|
*
|
2009-03-18 17:55:58 +00:00
|
|
|
* @package cake
|
2008-10-30 17:30:26 +00:00
|
|
|
* @subpackage cake.tests.cases.libs.model
|
2008-05-30 11:40:08 +00:00
|
|
|
*/
|
|
|
|
class NumericArticle extends CakeTestModel {
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-02 19:22:55 +00:00
|
|
|
/**
|
|
|
|
* name property
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2008-06-02 19:22:55 +00:00
|
|
|
* @var string 'NumericArticle'
|
|
|
|
* @access public
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
var $name = 'NumericArticle';
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-02 19:22:55 +00:00
|
|
|
/**
|
|
|
|
* useTable property
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2008-06-02 19:22:55 +00:00
|
|
|
* @var string 'numeric_articles'
|
|
|
|
* @access public
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
var $useTable = 'numeric_articles';
|
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-05-30 11:40:08 +00:00
|
|
|
/**
|
2008-08-05 03:22:25 +00:00
|
|
|
* Article10 class
|
2008-05-30 11:40:08 +00:00
|
|
|
*
|
2009-03-18 17:55:58 +00:00
|
|
|
* @package cake
|
2008-10-30 17:30:26 +00:00
|
|
|
* @subpackage cake.tests.cases.libs.model
|
2008-05-30 11:40:08 +00:00
|
|
|
*/
|
|
|
|
class Article10 extends CakeTestModel {
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-02 19:22:55 +00:00
|
|
|
/**
|
|
|
|
* name property
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2008-06-02 19:22:55 +00:00
|
|
|
* @var string 'Article10'
|
|
|
|
* @access public
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
var $name = 'Article10';
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-02 19:22:55 +00:00
|
|
|
/**
|
|
|
|
* useTable property
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2008-06-02 19:22:55 +00:00
|
|
|
* @var string 'articles'
|
|
|
|
* @access public
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
var $useTable = 'articles';
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-02 19:22:55 +00:00
|
|
|
/**
|
|
|
|
* hasMany property
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2008-06-02 19:22:55 +00:00
|
|
|
* @var array
|
|
|
|
* @access public
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
var $hasMany = array('Comment' => array('dependent' => true, 'exclusive' => true));
|
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-05-30 11:40:08 +00:00
|
|
|
/**
|
2008-08-05 03:22:25 +00:00
|
|
|
* ArticleFeatured class
|
2008-05-30 11:40:08 +00:00
|
|
|
*
|
2009-03-18 17:55:58 +00:00
|
|
|
* @package cake
|
2008-10-30 17:30:26 +00:00
|
|
|
* @subpackage cake.tests.cases.libs.model
|
2008-05-30 11:40:08 +00:00
|
|
|
*/
|
|
|
|
class ArticleFeatured extends CakeTestModel {
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-02 19:22:55 +00:00
|
|
|
/**
|
|
|
|
* name property
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2008-06-02 19:22:55 +00:00
|
|
|
* @var string 'ArticleFeatured'
|
|
|
|
* @access public
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
var $name = 'ArticleFeatured';
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-02 19:22:55 +00:00
|
|
|
/**
|
|
|
|
* belongsTo property
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2008-06-02 19:22:55 +00:00
|
|
|
* @var array
|
|
|
|
* @access public
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
var $belongsTo = array('User', 'Category');
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-02 19:22:55 +00:00
|
|
|
/**
|
|
|
|
* hasOne property
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2008-06-02 19:22:55 +00:00
|
|
|
* @var array
|
|
|
|
* @access public
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
var $hasOne = array('Featured');
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-02 19:22:55 +00:00
|
|
|
/**
|
|
|
|
* hasMany property
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2008-06-02 19:22:55 +00:00
|
|
|
* @var array
|
|
|
|
* @access public
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
var $hasMany = array('Comment' => array('className' => 'Comment', 'dependent' => true));
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-02 19:22:55 +00:00
|
|
|
/**
|
|
|
|
* hasAndBelongsToMany property
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2008-06-02 19:22:55 +00:00
|
|
|
* @var array
|
|
|
|
* @access public
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
var $hasAndBelongsToMany = array('Tag');
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-02 19:22:55 +00:00
|
|
|
/**
|
|
|
|
* validate property
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2008-06-02 19:22:55 +00:00
|
|
|
* @var array
|
|
|
|
* @access public
|
|
|
|
*/
|
2009-01-15 01:55:31 +00:00
|
|
|
var $validate = array('user_id' => 'numeric', 'title' => 'notEmpty', 'body' => 'notEmpty');
|
2008-05-30 11:40:08 +00:00
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-05-30 11:40:08 +00:00
|
|
|
/**
|
2008-08-05 03:22:25 +00:00
|
|
|
* Featured class
|
2008-05-30 11:40:08 +00:00
|
|
|
*
|
2009-03-18 17:55:58 +00:00
|
|
|
* @package cake
|
2008-10-30 17:30:26 +00:00
|
|
|
* @subpackage cake.tests.cases.libs.model
|
2008-05-30 11:40:08 +00:00
|
|
|
*/
|
|
|
|
class Featured extends CakeTestModel {
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-02 19:22:55 +00:00
|
|
|
/**
|
|
|
|
* name property
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2008-06-02 19:22:55 +00:00
|
|
|
* @var string 'Featured'
|
|
|
|
* @access public
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
var $name = 'Featured';
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-02 19:22:55 +00:00
|
|
|
/**
|
|
|
|
* belongsTo property
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2008-06-02 19:22:55 +00:00
|
|
|
* @var array
|
|
|
|
* @access public
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
var $belongsTo = array('ArticleFeatured', 'Category');
|
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-05-30 11:40:08 +00:00
|
|
|
/**
|
2008-08-05 03:22:25 +00:00
|
|
|
* Tag class
|
2008-05-30 11:40:08 +00:00
|
|
|
*
|
2009-03-18 17:55:58 +00:00
|
|
|
* @package cake
|
2008-10-30 17:30:26 +00:00
|
|
|
* @subpackage cake.tests.cases.libs.model
|
2008-05-30 11:40:08 +00:00
|
|
|
*/
|
|
|
|
class Tag extends CakeTestModel {
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-02 19:22:55 +00:00
|
|
|
/**
|
|
|
|
* name property
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2008-06-02 19:22:55 +00:00
|
|
|
* @var string 'Tag'
|
|
|
|
* @access public
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
var $name = 'Tag';
|
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-05-30 11:40:08 +00:00
|
|
|
/**
|
2008-08-05 03:22:25 +00:00
|
|
|
* ArticlesTag class
|
2008-05-30 11:40:08 +00:00
|
|
|
*
|
2009-03-18 17:55:58 +00:00
|
|
|
* @package cake
|
2008-10-30 17:30:26 +00:00
|
|
|
* @subpackage cake.tests.cases.libs.model
|
2008-05-30 11:40:08 +00:00
|
|
|
*/
|
|
|
|
class ArticlesTag extends CakeTestModel {
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-02 19:22:55 +00:00
|
|
|
/**
|
|
|
|
* name property
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2008-06-02 19:22:55 +00:00
|
|
|
* @var string 'ArticlesTag'
|
|
|
|
* @access public
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
var $name = 'ArticlesTag';
|
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-05-30 11:40:08 +00:00
|
|
|
/**
|
2008-08-05 03:22:25 +00:00
|
|
|
* ArticleFeaturedsTag class
|
2008-05-30 11:40:08 +00:00
|
|
|
*
|
2009-03-18 17:55:58 +00:00
|
|
|
* @package cake
|
2008-10-30 17:30:26 +00:00
|
|
|
* @subpackage cake.tests.cases.libs.model
|
2008-05-30 11:40:08 +00:00
|
|
|
*/
|
|
|
|
class ArticleFeaturedsTag extends CakeTestModel {
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-02 19:22:55 +00:00
|
|
|
/**
|
|
|
|
* name property
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2008-06-02 19:22:55 +00:00
|
|
|
* @var string 'ArticleFeaturedsTag'
|
|
|
|
* @access public
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
var $name = 'ArticleFeaturedsTag';
|
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-05-30 11:40:08 +00:00
|
|
|
/**
|
2008-08-05 03:22:25 +00:00
|
|
|
* Comment class
|
2008-05-30 11:40:08 +00:00
|
|
|
*
|
2009-03-18 17:55:58 +00:00
|
|
|
* @package cake
|
2008-10-30 17:30:26 +00:00
|
|
|
* @subpackage cake.tests.cases.libs.model
|
2008-05-30 11:40:08 +00:00
|
|
|
*/
|
|
|
|
class Comment extends CakeTestModel {
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-02 19:22:55 +00:00
|
|
|
/**
|
|
|
|
* name property
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2008-06-02 19:22:55 +00:00
|
|
|
* @var string 'Comment'
|
|
|
|
* @access public
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
var $name = 'Comment';
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-02 19:22:55 +00:00
|
|
|
/**
|
|
|
|
* belongsTo property
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2008-06-02 19:22:55 +00:00
|
|
|
* @var array
|
|
|
|
* @access public
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
var $belongsTo = array('Article', 'User');
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-02 19:22:55 +00:00
|
|
|
/**
|
|
|
|
* hasOne property
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2008-06-02 19:22:55 +00:00
|
|
|
* @var array
|
|
|
|
* @access public
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
var $hasOne = array('Attachment' => array('dependent' => true));
|
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-07-20 17:25:39 +00:00
|
|
|
/**
|
|
|
|
* Modified Comment Class has afterFind Callback
|
|
|
|
*
|
2009-03-18 17:55:58 +00:00
|
|
|
* @package cake
|
2008-10-30 17:30:26 +00:00
|
|
|
* @subpackage cake.tests.cases.libs.model
|
2008-07-20 17:25:39 +00:00
|
|
|
*/
|
|
|
|
class ModifiedComment extends CakeTestModel {
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-07-20 17:25:39 +00:00
|
|
|
/**
|
|
|
|
* name property
|
|
|
|
*
|
|
|
|
* @var string 'Comment'
|
|
|
|
* @access public
|
|
|
|
*/
|
|
|
|
var $name = 'Comment';
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-08-05 03:22:25 +00:00
|
|
|
/**
|
|
|
|
* useTable property
|
|
|
|
*
|
|
|
|
* @var string 'comments'
|
|
|
|
* @access public
|
|
|
|
*/
|
2008-07-20 17:25:39 +00:00
|
|
|
var $useTable = 'comments';
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-07-20 17:25:39 +00:00
|
|
|
/**
|
|
|
|
* belongsTo property
|
|
|
|
*
|
|
|
|
* @var array
|
|
|
|
* @access public
|
|
|
|
*/
|
|
|
|
var $belongsTo = array('Article');
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-07-20 17:25:39 +00:00
|
|
|
/**
|
|
|
|
* afterFind callback
|
|
|
|
*
|
|
|
|
* @return void
|
2009-11-14 12:19:25 +00:00
|
|
|
*/
|
2008-07-20 17:25:39 +00:00
|
|
|
function afterFind($results) {
|
|
|
|
if (isset($results[0])) {
|
|
|
|
$results[0]['Comment']['callback'] = 'Fire';
|
|
|
|
}
|
|
|
|
return $results;
|
|
|
|
}
|
|
|
|
}
|
2008-11-14 20:24:27 +00:00
|
|
|
|
2009-11-01 14:08:39 +00:00
|
|
|
/**
|
|
|
|
* Modified Comment Class has afterFind Callback
|
|
|
|
*
|
|
|
|
* @package cake
|
|
|
|
* @subpackage cake.tests.cases.libs.model
|
|
|
|
*/
|
|
|
|
class AgainModifiedComment extends CakeTestModel {
|
|
|
|
|
|
|
|
/**
|
|
|
|
* name property
|
|
|
|
*
|
|
|
|
* @var string 'Comment'
|
|
|
|
* @access public
|
|
|
|
*/
|
|
|
|
var $name = 'Comment';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* useTable property
|
|
|
|
*
|
|
|
|
* @var string 'comments'
|
|
|
|
* @access public
|
|
|
|
*/
|
|
|
|
var $useTable = 'comments';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* belongsTo property
|
|
|
|
*
|
|
|
|
* @var array
|
|
|
|
* @access public
|
|
|
|
*/
|
|
|
|
var $belongsTo = array('Article');
|
|
|
|
|
|
|
|
/**
|
|
|
|
* afterFind callback
|
|
|
|
*
|
|
|
|
* @return void
|
2009-11-14 12:19:25 +00:00
|
|
|
*/
|
2009-11-01 14:08:39 +00:00
|
|
|
function afterFind($results) {
|
|
|
|
if (isset($results[0])) {
|
|
|
|
$results[0]['Comment']['querytype'] = $this->findQueryType;
|
|
|
|
}
|
|
|
|
return $results;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-11-14 20:24:27 +00:00
|
|
|
/**
|
|
|
|
* MergeVarPluginAppModel class
|
|
|
|
*
|
2009-03-18 17:55:58 +00:00
|
|
|
* @package cake
|
2008-11-14 20:24:27 +00:00
|
|
|
* @subpackage cake.tests.cases.libs.model
|
|
|
|
*/
|
|
|
|
class MergeVarPluginAppModel extends AppModel {
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-11-14 20:24:27 +00:00
|
|
|
/**
|
|
|
|
* actsAs parameter
|
|
|
|
*
|
|
|
|
* @var array
|
|
|
|
*/
|
|
|
|
var $actsAs = array(
|
|
|
|
'Containable'
|
|
|
|
);
|
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-11-14 20:24:27 +00:00
|
|
|
/**
|
|
|
|
* MergeVarPluginPost class
|
|
|
|
*
|
2009-03-18 17:55:58 +00:00
|
|
|
* @package cake
|
2008-11-14 20:24:27 +00:00
|
|
|
* @subpackage cake.tests.cases.libs.model
|
|
|
|
*/
|
|
|
|
class MergeVarPluginPost extends MergeVarPluginAppModel {
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-11-14 20:24:27 +00:00
|
|
|
/**
|
|
|
|
* actsAs parameter
|
|
|
|
*
|
|
|
|
* @var array
|
|
|
|
*/
|
|
|
|
var $actsAs = array(
|
|
|
|
'Tree'
|
|
|
|
);
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-11-14 20:24:27 +00:00
|
|
|
/**
|
|
|
|
* useTable parameter
|
|
|
|
*
|
|
|
|
* @var string
|
|
|
|
*/
|
|
|
|
var $useTable = 'posts';
|
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-11-14 20:24:27 +00:00
|
|
|
/**
|
|
|
|
* MergeVarPluginComment class
|
|
|
|
*
|
2009-03-18 17:55:58 +00:00
|
|
|
* @package cake
|
2008-11-14 20:24:27 +00:00
|
|
|
* @subpackage cake.tests.cases.libs.model
|
|
|
|
*/
|
|
|
|
class MergeVarPluginComment extends MergeVarPluginAppModel {
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-11-14 20:24:27 +00:00
|
|
|
/**
|
|
|
|
* actsAs parameter
|
|
|
|
*
|
|
|
|
* @var array
|
|
|
|
*/
|
|
|
|
var $actsAs = array(
|
|
|
|
'Containable' => array('some_settings')
|
|
|
|
);
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-11-14 20:24:27 +00:00
|
|
|
/**
|
|
|
|
* useTable parameter
|
|
|
|
*
|
|
|
|
* @var string
|
|
|
|
*/
|
|
|
|
var $useTable = 'comments';
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2008-05-30 11:40:08 +00:00
|
|
|
/**
|
2008-08-05 03:22:25 +00:00
|
|
|
* Attachment class
|
2008-05-30 11:40:08 +00:00
|
|
|
*
|
2009-03-18 17:55:58 +00:00
|
|
|
* @package cake
|
2008-10-30 17:30:26 +00:00
|
|
|
* @subpackage cake.tests.cases.libs.model
|
2008-05-30 11:40:08 +00:00
|
|
|
*/
|
|
|
|
class Attachment extends CakeTestModel {
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-02 19:22:55 +00:00
|
|
|
/**
|
|
|
|
* name property
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2008-06-02 19:22:55 +00:00
|
|
|
* @var string 'Attachment'
|
|
|
|
* @access public
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
var $name = 'Attachment';
|
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-05-30 11:40:08 +00:00
|
|
|
/**
|
2008-08-05 03:22:25 +00:00
|
|
|
* Category class
|
2008-05-30 11:40:08 +00:00
|
|
|
*
|
2009-03-18 17:55:58 +00:00
|
|
|
* @package cake
|
2008-10-30 17:30:26 +00:00
|
|
|
* @subpackage cake.tests.cases.libs.model
|
2008-05-30 11:40:08 +00:00
|
|
|
*/
|
|
|
|
class Category extends CakeTestModel {
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-02 19:22:55 +00:00
|
|
|
/**
|
|
|
|
* name property
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2008-06-02 19:22:55 +00:00
|
|
|
* @var string 'Category'
|
|
|
|
* @access public
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
var $name = 'Category';
|
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-05-30 11:40:08 +00:00
|
|
|
/**
|
2008-08-05 03:22:25 +00:00
|
|
|
* CategoryThread class
|
2008-05-30 11:40:08 +00:00
|
|
|
*
|
2009-03-18 17:55:58 +00:00
|
|
|
* @package cake
|
2008-10-30 17:30:26 +00:00
|
|
|
* @subpackage cake.tests.cases.libs.model
|
2008-05-30 11:40:08 +00:00
|
|
|
*/
|
|
|
|
class CategoryThread extends CakeTestModel {
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-02 19:22:55 +00:00
|
|
|
/**
|
|
|
|
* name property
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2008-06-02 19:22:55 +00:00
|
|
|
* @var string 'CategoryThread'
|
|
|
|
* @access public
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
var $name = 'CategoryThread';
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-02 19:22:55 +00:00
|
|
|
/**
|
|
|
|
* belongsTo property
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2008-06-02 19:22:55 +00:00
|
|
|
* @var array
|
|
|
|
* @access public
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
var $belongsTo = array('ParentCategory' => array('className' => 'CategoryThread', 'foreignKey' => 'parent_id'));
|
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-05-30 11:40:08 +00:00
|
|
|
/**
|
2008-08-05 03:22:25 +00:00
|
|
|
* Apple class
|
2008-05-30 11:40:08 +00:00
|
|
|
*
|
2009-03-18 17:55:58 +00:00
|
|
|
* @package cake
|
2008-10-30 17:30:26 +00:00
|
|
|
* @subpackage cake.tests.cases.libs.model
|
2008-05-30 11:40:08 +00:00
|
|
|
*/
|
|
|
|
class Apple extends CakeTestModel {
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-02 19:22:55 +00:00
|
|
|
/**
|
|
|
|
* name property
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2008-06-02 19:22:55 +00:00
|
|
|
* @var string 'Apple'
|
|
|
|
* @access public
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
var $name = 'Apple';
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-02 19:22:55 +00:00
|
|
|
/**
|
|
|
|
* validate property
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2008-06-02 19:22:55 +00:00
|
|
|
* @var array
|
|
|
|
* @access public
|
|
|
|
*/
|
2009-01-15 01:55:31 +00:00
|
|
|
var $validate = array('name' => 'notEmpty');
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-02 19:22:55 +00:00
|
|
|
/**
|
|
|
|
* hasOne property
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2008-06-02 19:22:55 +00:00
|
|
|
* @var array
|
|
|
|
* @access public
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
var $hasOne = array('Sample');
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-02 19:22:55 +00:00
|
|
|
/**
|
|
|
|
* hasMany property
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2008-06-02 19:22:55 +00:00
|
|
|
* @var array
|
|
|
|
* @access public
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
var $hasMany = array('Child' => array('className' => 'Apple', 'dependent' => true));
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-02 19:22:55 +00:00
|
|
|
/**
|
|
|
|
* belongsTo property
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2008-06-02 19:22:55 +00:00
|
|
|
* @var array
|
|
|
|
* @access public
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
var $belongsTo = array('Parent' => array('className' => 'Apple', 'foreignKey' => 'apple_id'));
|
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-05-30 11:40:08 +00:00
|
|
|
/**
|
2008-08-05 03:22:25 +00:00
|
|
|
* Sample class
|
2008-05-30 11:40:08 +00:00
|
|
|
*
|
2009-03-18 17:55:58 +00:00
|
|
|
* @package cake
|
2008-10-30 17:30:26 +00:00
|
|
|
* @subpackage cake.tests.cases.libs.model
|
2008-05-30 11:40:08 +00:00
|
|
|
*/
|
|
|
|
class Sample extends CakeTestModel {
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-02 19:22:55 +00:00
|
|
|
/**
|
|
|
|
* name property
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2008-06-02 19:22:55 +00:00
|
|
|
* @var string 'Sample'
|
|
|
|
* @access public
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
var $name = 'Sample';
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-02 19:22:55 +00:00
|
|
|
/**
|
|
|
|
* belongsTo property
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2008-06-02 19:22:55 +00:00
|
|
|
* @var string 'Apple'
|
|
|
|
* @access public
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
var $belongsTo = 'Apple';
|
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-05-30 11:40:08 +00:00
|
|
|
/**
|
2008-08-05 03:22:25 +00:00
|
|
|
* AnotherArticle class
|
2008-05-30 11:40:08 +00:00
|
|
|
*
|
2009-03-18 17:55:58 +00:00
|
|
|
* @package cake
|
2008-10-30 17:30:26 +00:00
|
|
|
* @subpackage cake.tests.cases.libs.model
|
2008-05-30 11:40:08 +00:00
|
|
|
*/
|
|
|
|
class AnotherArticle extends CakeTestModel {
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-02 19:22:55 +00:00
|
|
|
/**
|
|
|
|
* name property
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2008-06-02 19:22:55 +00:00
|
|
|
* @var string 'AnotherArticle'
|
|
|
|
* @access public
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
var $name = 'AnotherArticle';
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-02 19:22:55 +00:00
|
|
|
/**
|
|
|
|
* hasMany property
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2008-06-02 19:22:55 +00:00
|
|
|
* @var string 'Home'
|
|
|
|
* @access public
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
var $hasMany = 'Home';
|
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-05-30 11:40:08 +00:00
|
|
|
/**
|
2008-08-05 03:22:25 +00:00
|
|
|
* Advertisement class
|
2008-05-30 11:40:08 +00:00
|
|
|
*
|
2009-03-18 17:55:58 +00:00
|
|
|
* @package cake
|
2008-10-30 17:30:26 +00:00
|
|
|
* @subpackage cake.tests.cases.libs.model
|
2008-05-30 11:40:08 +00:00
|
|
|
*/
|
|
|
|
class Advertisement extends CakeTestModel {
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-02 19:22:55 +00:00
|
|
|
/**
|
|
|
|
* name property
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2008-06-02 19:22:55 +00:00
|
|
|
* @var string 'Advertisement'
|
|
|
|
* @access public
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
var $name = 'Advertisement';
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-02 19:22:55 +00:00
|
|
|
/**
|
|
|
|
* hasMany property
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2008-06-02 19:22:55 +00:00
|
|
|
* @var string 'Home'
|
|
|
|
* @access public
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
var $hasMany = 'Home';
|
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-05-30 11:40:08 +00:00
|
|
|
/**
|
2008-08-05 03:22:25 +00:00
|
|
|
* Home class
|
2008-05-30 11:40:08 +00:00
|
|
|
*
|
2009-03-18 17:55:58 +00:00
|
|
|
* @package cake
|
2008-10-30 17:30:26 +00:00
|
|
|
* @subpackage cake.tests.cases.libs.model
|
2008-05-30 11:40:08 +00:00
|
|
|
*/
|
|
|
|
class Home extends CakeTestModel {
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-02 19:22:55 +00:00
|
|
|
/**
|
|
|
|
* name property
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2008-06-02 19:22:55 +00:00
|
|
|
* @var string 'Home'
|
|
|
|
* @access public
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
var $name = 'Home';
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-02 19:22:55 +00:00
|
|
|
/**
|
|
|
|
* belongsTo property
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2008-06-02 19:22:55 +00:00
|
|
|
* @var array
|
|
|
|
* @access public
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
var $belongsTo = array('AnotherArticle', 'Advertisement');
|
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-05-30 11:40:08 +00:00
|
|
|
/**
|
2008-08-05 03:22:25 +00:00
|
|
|
* Post class
|
2008-05-30 11:40:08 +00:00
|
|
|
*
|
2009-03-18 17:55:58 +00:00
|
|
|
* @package cake
|
2008-10-30 17:30:26 +00:00
|
|
|
* @subpackage cake.tests.cases.libs.model
|
2008-05-30 11:40:08 +00:00
|
|
|
*/
|
|
|
|
class Post extends CakeTestModel {
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-02 19:22:55 +00:00
|
|
|
/**
|
|
|
|
* name property
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2008-06-02 19:22:55 +00:00
|
|
|
* @var string 'Post'
|
|
|
|
* @access public
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
var $name = 'Post';
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-02 19:22:55 +00:00
|
|
|
/**
|
|
|
|
* belongsTo property
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2008-06-02 19:22:55 +00:00
|
|
|
* @var array
|
|
|
|
* @access public
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
var $belongsTo = array('Author');
|
2009-09-10 13:28:55 +00:00
|
|
|
|
|
|
|
function beforeFind($queryData) {
|
|
|
|
if (isset($queryData['connection'])) {
|
|
|
|
$this->useDbConfig = $queryData['connection'];
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
function afterFind($results) {
|
|
|
|
$this->useDbConfig = 'test_suite';
|
|
|
|
return $results;
|
|
|
|
}
|
2008-05-30 11:40:08 +00:00
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-05-30 11:40:08 +00:00
|
|
|
/**
|
2008-08-05 03:22:25 +00:00
|
|
|
* Author class
|
2008-05-30 11:40:08 +00:00
|
|
|
*
|
2009-03-18 17:55:58 +00:00
|
|
|
* @package cake
|
2008-10-30 17:30:26 +00:00
|
|
|
* @subpackage cake.tests.cases.libs.model
|
2008-05-30 11:40:08 +00:00
|
|
|
*/
|
|
|
|
class Author extends CakeTestModel {
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-02 19:22:55 +00:00
|
|
|
/**
|
|
|
|
* name property
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2008-06-02 19:22:55 +00:00
|
|
|
* @var string 'Author'
|
|
|
|
* @access public
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
var $name = 'Author';
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-02 19:22:55 +00:00
|
|
|
/**
|
|
|
|
* hasMany property
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2008-06-02 19:22:55 +00:00
|
|
|
* @var array
|
|
|
|
* @access public
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
var $hasMany = array('Post');
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-02 19:22:55 +00:00
|
|
|
/**
|
|
|
|
* afterFind method
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
|
|
|
* @param mixed $results
|
2008-06-02 19:22:55 +00:00
|
|
|
* @access public
|
|
|
|
* @return void
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
function afterFind($results) {
|
|
|
|
$results[0]['Author']['test'] = 'working';
|
|
|
|
return $results;
|
|
|
|
}
|
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-05-30 11:40:08 +00:00
|
|
|
/**
|
2008-08-05 03:22:25 +00:00
|
|
|
* ModifiedAuthor class
|
2008-05-30 11:40:08 +00:00
|
|
|
*
|
2009-03-18 17:55:58 +00:00
|
|
|
* @package cake
|
2008-10-30 17:30:26 +00:00
|
|
|
* @subpackage cake.tests.cases.libs.model
|
2008-05-30 11:40:08 +00:00
|
|
|
*/
|
|
|
|
class ModifiedAuthor extends Author {
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-05 15:20:45 +00:00
|
|
|
/**
|
|
|
|
* name property
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2008-06-05 15:20:45 +00:00
|
|
|
* @var string 'Author'
|
|
|
|
* @access public
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
var $name = 'Author';
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-05 15:20:45 +00:00
|
|
|
/**
|
|
|
|
* afterFind method
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
|
|
|
* @param mixed $results
|
2008-06-05 15:20:45 +00:00
|
|
|
* @access public
|
|
|
|
* @return void
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
function afterFind($results) {
|
|
|
|
foreach($results as $index => $result) {
|
|
|
|
$results[$index]['Author']['user'] .= ' (CakePHP)';
|
|
|
|
}
|
|
|
|
return $results;
|
|
|
|
}
|
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-05-30 11:40:08 +00:00
|
|
|
/**
|
2008-08-05 03:22:25 +00:00
|
|
|
* Project class
|
2008-05-30 11:40:08 +00:00
|
|
|
*
|
2009-03-18 17:55:58 +00:00
|
|
|
* @package cake
|
2008-10-30 17:30:26 +00:00
|
|
|
* @subpackage cake.tests.cases.libs.model
|
2008-05-30 11:40:08 +00:00
|
|
|
*/
|
|
|
|
class Project extends CakeTestModel {
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-05 15:20:45 +00:00
|
|
|
/**
|
|
|
|
* name property
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2008-06-05 15:20:45 +00:00
|
|
|
* @var string 'Project'
|
|
|
|
* @access public
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
var $name = 'Project';
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-05 15:20:45 +00:00
|
|
|
/**
|
|
|
|
* hasMany property
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2008-06-05 15:20:45 +00:00
|
|
|
* @var array
|
|
|
|
* @access public
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
var $hasMany = array('Thread');
|
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-05-30 11:40:08 +00:00
|
|
|
/**
|
2008-08-05 03:22:25 +00:00
|
|
|
* Thread class
|
2008-05-30 11:40:08 +00:00
|
|
|
*
|
2009-03-18 17:55:58 +00:00
|
|
|
* @package cake
|
2008-10-30 17:30:26 +00:00
|
|
|
* @subpackage cake.tests.cases.libs.model
|
2008-05-30 11:40:08 +00:00
|
|
|
*/
|
|
|
|
class Thread extends CakeTestModel {
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-05 15:20:45 +00:00
|
|
|
/**
|
|
|
|
* name property
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2008-06-05 15:20:45 +00:00
|
|
|
* @var string 'Thread'
|
|
|
|
* @access public
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
var $name = 'Thread';
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-15 09:08:50 +00:00
|
|
|
/**
|
|
|
|
* hasMany property
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2008-06-15 09:08:50 +00:00
|
|
|
* @var array
|
|
|
|
* @access public
|
|
|
|
*/
|
|
|
|
var $belongsTo = array('Project');
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-05 15:20:45 +00:00
|
|
|
/**
|
|
|
|
* hasMany property
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2008-06-05 15:20:45 +00:00
|
|
|
* @var array
|
|
|
|
* @access public
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
var $hasMany = array('Message');
|
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-05-30 11:40:08 +00:00
|
|
|
/**
|
2008-08-05 03:22:25 +00:00
|
|
|
* Message class
|
2008-05-30 11:40:08 +00:00
|
|
|
*
|
2009-03-18 17:55:58 +00:00
|
|
|
* @package cake
|
2008-10-30 17:30:26 +00:00
|
|
|
* @subpackage cake.tests.cases.libs.model
|
2008-05-30 11:40:08 +00:00
|
|
|
*/
|
|
|
|
class Message extends CakeTestModel {
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-05 15:20:45 +00:00
|
|
|
/**
|
|
|
|
* name property
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2008-06-05 15:20:45 +00:00
|
|
|
* @var string 'Message'
|
|
|
|
* @access public
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
var $name = 'Message';
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-05 15:20:45 +00:00
|
|
|
/**
|
|
|
|
* hasOne property
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2008-06-05 15:20:45 +00:00
|
|
|
* @var array
|
|
|
|
* @access public
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
var $hasOne = array('Bid');
|
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-05-30 11:40:08 +00:00
|
|
|
/**
|
2008-08-05 03:22:25 +00:00
|
|
|
* Bid class
|
2008-05-30 11:40:08 +00:00
|
|
|
*
|
2009-03-18 17:55:58 +00:00
|
|
|
* @package cake
|
2008-10-30 17:30:26 +00:00
|
|
|
* @subpackage cake.tests.cases.libs.model
|
2008-05-30 11:40:08 +00:00
|
|
|
*/
|
|
|
|
class Bid extends CakeTestModel {
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-05 15:20:45 +00:00
|
|
|
/**
|
|
|
|
* name property
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2008-06-05 15:20:45 +00:00
|
|
|
* @var string 'Bid'
|
|
|
|
* @access public
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
var $name = 'Bid';
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-05 15:20:45 +00:00
|
|
|
/**
|
|
|
|
* belongsTo property
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2008-06-05 15:20:45 +00:00
|
|
|
* @var array
|
|
|
|
* @access public
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
var $belongsTo = array('Message');
|
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-05 15:20:45 +00:00
|
|
|
/**
|
|
|
|
* NodeAfterFind class
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2009-03-18 17:55:58 +00:00
|
|
|
* @package cake
|
2008-10-30 17:30:26 +00:00
|
|
|
* @subpackage cake.tests.cases.libs.model
|
2008-06-05 15:20:45 +00:00
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
class NodeAfterFind extends CakeTestModel {
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-05 15:20:45 +00:00
|
|
|
/**
|
|
|
|
* name property
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2008-06-05 15:20:45 +00:00
|
|
|
* @var string 'NodeAfterFind'
|
|
|
|
* @access public
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
var $name = 'NodeAfterFind';
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-05 15:20:45 +00:00
|
|
|
/**
|
|
|
|
* validate property
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2008-06-05 15:20:45 +00:00
|
|
|
* @var array
|
|
|
|
* @access public
|
|
|
|
*/
|
2009-01-15 01:55:31 +00:00
|
|
|
var $validate = array('name' => 'notEmpty');
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-05 15:20:45 +00:00
|
|
|
/**
|
|
|
|
* useTable property
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2008-06-05 15:20:45 +00:00
|
|
|
* @var string 'apples'
|
|
|
|
* @access public
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
var $useTable = 'apples';
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-05 15:20:45 +00:00
|
|
|
/**
|
|
|
|
* hasOne property
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2008-06-05 15:20:45 +00:00
|
|
|
* @var array
|
|
|
|
* @access public
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
var $hasOne = array('Sample' => array('className' => 'NodeAfterFindSample'));
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-05 15:20:45 +00:00
|
|
|
/**
|
|
|
|
* hasMany property
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2008-06-05 15:20:45 +00:00
|
|
|
* @var array
|
|
|
|
* @access public
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
var $hasMany = array('Child' => array('className' => 'NodeAfterFind', 'dependent' => true));
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-05 15:20:45 +00:00
|
|
|
/**
|
|
|
|
* belongsTo property
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2008-06-05 15:20:45 +00:00
|
|
|
* @var array
|
|
|
|
* @access public
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
var $belongsTo = array('Parent' => array('className' => 'NodeAfterFind', 'foreignKey' => 'apple_id'));
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-05 15:20:45 +00:00
|
|
|
/**
|
|
|
|
* afterFind method
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
|
|
|
* @param mixed $results
|
2008-06-05 15:20:45 +00:00
|
|
|
* @access public
|
|
|
|
* @return void
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
function afterFind($results) {
|
|
|
|
return $results;
|
|
|
|
}
|
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-05 15:20:45 +00:00
|
|
|
/**
|
|
|
|
* NodeAfterFindSample class
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2009-03-18 17:55:58 +00:00
|
|
|
* @package cake
|
2008-10-30 17:30:26 +00:00
|
|
|
* @subpackage cake.tests.cases.libs.model
|
2008-06-05 15:20:45 +00:00
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
class NodeAfterFindSample extends CakeTestModel {
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-05 15:20:45 +00:00
|
|
|
/**
|
|
|
|
* name property
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2008-06-05 15:20:45 +00:00
|
|
|
* @var string 'NodeAfterFindSample'
|
|
|
|
* @access public
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
var $name = 'NodeAfterFindSample';
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-05 15:20:45 +00:00
|
|
|
/**
|
|
|
|
* useTable property
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2008-06-05 15:20:45 +00:00
|
|
|
* @var string 'samples'
|
|
|
|
* @access public
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
var $useTable = 'samples';
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-05 15:20:45 +00:00
|
|
|
/**
|
|
|
|
* belongsTo property
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2008-06-05 15:20:45 +00:00
|
|
|
* @var string 'NodeAfterFind'
|
|
|
|
* @access public
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
var $belongsTo = 'NodeAfterFind';
|
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-05 15:20:45 +00:00
|
|
|
/**
|
|
|
|
* NodeNoAfterFind class
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2009-03-18 17:55:58 +00:00
|
|
|
* @package cake
|
2008-10-30 17:30:26 +00:00
|
|
|
* @subpackage cake.tests.cases.libs.model
|
2008-06-05 15:20:45 +00:00
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
class NodeNoAfterFind extends CakeTestModel {
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-05 15:20:45 +00:00
|
|
|
/**
|
|
|
|
* name property
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2008-06-05 15:20:45 +00:00
|
|
|
* @var string 'NodeAfterFind'
|
|
|
|
* @access public
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
var $name = 'NodeAfterFind';
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-05 15:20:45 +00:00
|
|
|
/**
|
|
|
|
* validate property
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2008-06-05 15:20:45 +00:00
|
|
|
* @var array
|
|
|
|
* @access public
|
|
|
|
*/
|
2009-01-15 01:55:31 +00:00
|
|
|
var $validate = array('name' => 'notEmpty');
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-05 15:20:45 +00:00
|
|
|
/**
|
|
|
|
* useTable property
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2008-06-05 15:20:45 +00:00
|
|
|
* @var string 'apples'
|
|
|
|
* @access public
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
var $useTable = 'apples';
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-05 15:20:45 +00:00
|
|
|
/**
|
|
|
|
* hasOne property
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2008-06-05 15:20:45 +00:00
|
|
|
* @var array
|
|
|
|
* @access public
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
var $hasOne = array('Sample' => array('className' => 'NodeAfterFindSample'));
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-05 15:20:45 +00:00
|
|
|
/**
|
|
|
|
* hasMany property
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2008-06-05 15:20:45 +00:00
|
|
|
* @var array
|
|
|
|
* @access public
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
var $hasMany = array('Child' => array('className' => 'NodeAfterFind', 'dependent' => true));
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-05 15:20:45 +00:00
|
|
|
/**
|
|
|
|
* belongsTo property
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2008-06-05 15:20:45 +00:00
|
|
|
* @var array
|
|
|
|
* @access public
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
var $belongsTo = array('Parent' => array('className' => 'NodeAfterFind', 'foreignKey' => 'apple_id'));
|
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-05 15:20:45 +00:00
|
|
|
/**
|
|
|
|
* Node class
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2009-03-18 17:55:58 +00:00
|
|
|
* @package cake
|
2008-10-30 17:30:26 +00:00
|
|
|
* @subpackage cake.tests.cases.libs.model
|
2008-06-05 15:20:45 +00:00
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
class Node extends CakeTestModel{
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-05 15:20:45 +00:00
|
|
|
/**
|
|
|
|
* name property
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2008-06-05 15:20:45 +00:00
|
|
|
* @var string 'Node'
|
|
|
|
* @access public
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
var $name = 'Node';
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-05 15:20:45 +00:00
|
|
|
/**
|
|
|
|
* hasAndBelongsToMany property
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2008-06-05 15:20:45 +00:00
|
|
|
* @var array
|
|
|
|
* @access public
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
var $hasAndBelongsToMany = array(
|
|
|
|
'ParentNode' => array(
|
|
|
|
'className' => 'Node',
|
|
|
|
'joinTable' => 'dependency',
|
2008-10-13 01:17:34 +00:00
|
|
|
'with' => 'Dependency',
|
2008-05-30 11:40:08 +00:00
|
|
|
'foreignKey' => 'child_id',
|
|
|
|
'associationForeignKey' => 'parent_id',
|
|
|
|
)
|
|
|
|
);
|
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-05 15:20:45 +00:00
|
|
|
/**
|
|
|
|
* Dependency class
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2009-03-18 17:55:58 +00:00
|
|
|
* @package cake
|
2008-10-30 17:30:26 +00:00
|
|
|
* @subpackage cake.tests.cases.libs.model
|
2008-06-05 15:20:45 +00:00
|
|
|
*/
|
2008-09-04 01:00:08 +00:00
|
|
|
class Dependency extends CakeTestModel {
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-05 15:20:45 +00:00
|
|
|
/**
|
|
|
|
* name property
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2008-06-05 15:20:45 +00:00
|
|
|
* @var string 'Dependency'
|
|
|
|
* @access public
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
var $name = 'Dependency';
|
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-05 15:20:45 +00:00
|
|
|
/**
|
|
|
|
* ModelA class
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2009-03-18 17:55:58 +00:00
|
|
|
* @package cake
|
2008-10-30 17:30:26 +00:00
|
|
|
* @subpackage cake.tests.cases.libs.model
|
2008-06-05 15:20:45 +00:00
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
class ModelA extends CakeTestModel {
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-05 15:20:45 +00:00
|
|
|
/**
|
|
|
|
* name property
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2008-06-05 15:20:45 +00:00
|
|
|
* @var string 'ModelA'
|
|
|
|
* @access public
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
var $name = 'ModelA';
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-05 15:20:45 +00:00
|
|
|
/**
|
|
|
|
* useTable property
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2008-06-05 15:20:45 +00:00
|
|
|
* @var string 'apples'
|
|
|
|
* @access public
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
var $useTable = 'apples';
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-05 15:20:45 +00:00
|
|
|
/**
|
|
|
|
* hasMany property
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2008-06-05 15:20:45 +00:00
|
|
|
* @var array
|
|
|
|
* @access public
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
var $hasMany = array('ModelB', 'ModelC');
|
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-05 15:20:45 +00:00
|
|
|
/**
|
|
|
|
* ModelB class
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2009-03-18 17:55:58 +00:00
|
|
|
* @package cake
|
2008-10-30 17:30:26 +00:00
|
|
|
* @subpackage cake.tests.cases.libs.model
|
2008-06-05 15:20:45 +00:00
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
class ModelB extends CakeTestModel {
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-05 15:20:45 +00:00
|
|
|
/**
|
|
|
|
* name property
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2008-06-05 15:20:45 +00:00
|
|
|
* @var string 'ModelB'
|
|
|
|
* @access public
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
var $name = 'ModelB';
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-05 15:20:45 +00:00
|
|
|
/**
|
|
|
|
* useTable property
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2008-06-05 15:20:45 +00:00
|
|
|
* @var string 'messages'
|
|
|
|
* @access public
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
var $useTable = 'messages';
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-05 15:20:45 +00:00
|
|
|
/**
|
|
|
|
* hasMany property
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2008-06-05 15:20:45 +00:00
|
|
|
* @var array
|
|
|
|
* @access public
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
var $hasMany = array('ModelD');
|
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-05 15:20:45 +00:00
|
|
|
/**
|
|
|
|
* ModelC class
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2009-03-18 17:55:58 +00:00
|
|
|
* @package cake
|
2008-10-30 17:30:26 +00:00
|
|
|
* @subpackage cake.tests.cases.libs.model
|
2008-06-05 15:20:45 +00:00
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
class ModelC extends CakeTestModel {
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-05 15:20:45 +00:00
|
|
|
/**
|
|
|
|
* name property
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2008-06-05 15:20:45 +00:00
|
|
|
* @var string 'ModelC'
|
|
|
|
* @access public
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
var $name = 'ModelC';
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-05 15:20:45 +00:00
|
|
|
/**
|
|
|
|
* useTable property
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2008-06-05 15:20:45 +00:00
|
|
|
* @var string 'bids'
|
|
|
|
* @access public
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
var $useTable = 'bids';
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-05 15:20:45 +00:00
|
|
|
/**
|
|
|
|
* hasMany property
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2008-06-05 15:20:45 +00:00
|
|
|
* @var array
|
|
|
|
* @access public
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
var $hasMany = array('ModelD');
|
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-05 15:20:45 +00:00
|
|
|
/**
|
|
|
|
* ModelD class
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2009-03-18 17:55:58 +00:00
|
|
|
* @package cake
|
2008-10-30 17:30:26 +00:00
|
|
|
* @subpackage cake.tests.cases.libs.model
|
2008-06-05 15:20:45 +00:00
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
class ModelD extends CakeTestModel {
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-05 15:20:45 +00:00
|
|
|
/**
|
|
|
|
* name property
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2008-06-05 15:20:45 +00:00
|
|
|
* @var string 'ModelD'
|
|
|
|
* @access public
|
|
|
|
*/
|
|
|
|
var $name = 'ModelD';
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-05 15:20:45 +00:00
|
|
|
/**
|
|
|
|
* useTable property
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2008-06-05 15:20:45 +00:00
|
|
|
* @var string 'threads'
|
|
|
|
* @access public
|
|
|
|
*/
|
|
|
|
var $useTable = 'threads';
|
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-05 15:20:45 +00:00
|
|
|
/**
|
|
|
|
* Something class
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2009-03-18 17:55:58 +00:00
|
|
|
* @package cake
|
2008-10-30 17:30:26 +00:00
|
|
|
* @subpackage cake.tests.cases.libs.model
|
2008-06-05 15:20:45 +00:00
|
|
|
*/
|
|
|
|
class Something extends CakeTestModel {
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-05 15:20:45 +00:00
|
|
|
/**
|
|
|
|
* name property
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2008-06-05 15:20:45 +00:00
|
|
|
* @var string 'Something'
|
|
|
|
* @access public
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
var $name = 'Something';
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-05 15:20:45 +00:00
|
|
|
/**
|
|
|
|
* hasAndBelongsToMany property
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2008-06-05 15:20:45 +00:00
|
|
|
* @var array
|
|
|
|
* @access public
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
var $hasAndBelongsToMany = array('SomethingElse' => array('with' => array('JoinThing' => array('doomed'))));
|
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-05 15:20:45 +00:00
|
|
|
/**
|
|
|
|
* SomethingElse class
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2009-03-18 17:55:58 +00:00
|
|
|
* @package cake
|
2008-10-30 17:30:26 +00:00
|
|
|
* @subpackage cake.tests.cases.libs.model
|
2008-06-05 15:20:45 +00:00
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
class SomethingElse extends CakeTestModel {
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-05 15:20:45 +00:00
|
|
|
/**
|
|
|
|
* name property
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2008-06-05 15:20:45 +00:00
|
|
|
* @var string 'SomethingElse'
|
|
|
|
* @access public
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
var $name = 'SomethingElse';
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-05 15:20:45 +00:00
|
|
|
/**
|
|
|
|
* hasAndBelongsToMany property
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2008-06-05 15:20:45 +00:00
|
|
|
* @var array
|
|
|
|
* @access public
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
var $hasAndBelongsToMany = array('Something' => array('with' => 'JoinThing'));
|
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-05 15:20:45 +00:00
|
|
|
/**
|
|
|
|
* JoinThing class
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2009-03-18 17:55:58 +00:00
|
|
|
* @package cake
|
2008-10-30 17:30:26 +00:00
|
|
|
* @subpackage cake.tests.cases.libs.model
|
2008-06-05 15:20:45 +00:00
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
class JoinThing extends CakeTestModel {
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-05 15:20:45 +00:00
|
|
|
/**
|
|
|
|
* name property
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2008-06-05 15:20:45 +00:00
|
|
|
* @var string 'JoinThing'
|
|
|
|
* @access public
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
var $name = 'JoinThing';
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-05 15:20:45 +00:00
|
|
|
/**
|
|
|
|
* belongsTo property
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2008-06-05 15:20:45 +00:00
|
|
|
* @var array
|
|
|
|
* @access public
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
var $belongsTo = array('Something', 'SomethingElse');
|
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-05 15:20:45 +00:00
|
|
|
/**
|
|
|
|
* Portfolio class
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2009-03-18 17:55:58 +00:00
|
|
|
* @package cake
|
2008-10-30 17:30:26 +00:00
|
|
|
* @subpackage cake.tests.cases.libs.model
|
2008-06-05 15:20:45 +00:00
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
class Portfolio extends CakeTestModel {
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-05 15:20:45 +00:00
|
|
|
/**
|
|
|
|
* name property
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2008-06-05 15:20:45 +00:00
|
|
|
* @var string 'Portfolio'
|
|
|
|
* @access public
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
var $name = 'Portfolio';
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-05 15:20:45 +00:00
|
|
|
/**
|
|
|
|
* hasAndBelongsToMany property
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2008-06-05 15:20:45 +00:00
|
|
|
* @var array
|
|
|
|
* @access public
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
var $hasAndBelongsToMany = array('Item');
|
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-05 15:20:45 +00:00
|
|
|
/**
|
|
|
|
* Item class
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2009-03-18 17:55:58 +00:00
|
|
|
* @package cake
|
2008-10-30 17:30:26 +00:00
|
|
|
* @subpackage cake.tests.cases.libs.model
|
2008-06-05 15:20:45 +00:00
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
class Item extends CakeTestModel {
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-05 15:20:45 +00:00
|
|
|
/**
|
|
|
|
* name property
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2008-06-05 15:20:45 +00:00
|
|
|
* @var string 'Item'
|
|
|
|
* @access public
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
var $name = 'Item';
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-05 15:20:45 +00:00
|
|
|
/**
|
|
|
|
* belongsTo property
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2008-06-05 15:20:45 +00:00
|
|
|
* @var array
|
|
|
|
* @access public
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
var $belongsTo = array('Syfile' => array('counterCache' => true));
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-05 15:20:45 +00:00
|
|
|
/**
|
|
|
|
* hasAndBelongsToMany property
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2008-06-05 15:20:45 +00:00
|
|
|
* @var array
|
|
|
|
* @access public
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
var $hasAndBelongsToMany = array('Portfolio' => array('unique' => false));
|
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-05 15:20:45 +00:00
|
|
|
/**
|
|
|
|
* ItemsPortfolio class
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2009-03-18 17:55:58 +00:00
|
|
|
* @package cake
|
2008-10-30 17:30:26 +00:00
|
|
|
* @subpackage cake.tests.cases.libs.model
|
2008-06-05 15:20:45 +00:00
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
class ItemsPortfolio extends CakeTestModel {
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-05 15:20:45 +00:00
|
|
|
/**
|
|
|
|
* name property
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2008-06-05 15:20:45 +00:00
|
|
|
* @var string 'ItemsPortfolio'
|
|
|
|
* @access public
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
var $name = 'ItemsPortfolio';
|
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-05 15:20:45 +00:00
|
|
|
/**
|
|
|
|
* Syfile class
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2009-03-18 17:55:58 +00:00
|
|
|
* @package cake
|
2008-10-30 17:30:26 +00:00
|
|
|
* @subpackage cake.tests.cases.libs.model
|
2008-06-05 15:20:45 +00:00
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
class Syfile extends CakeTestModel {
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-05 15:20:45 +00:00
|
|
|
/**
|
|
|
|
* name property
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2008-06-05 15:20:45 +00:00
|
|
|
* @var string 'Syfile'
|
|
|
|
* @access public
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
var $name = 'Syfile';
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-05 15:20:45 +00:00
|
|
|
/**
|
|
|
|
* belongsTo property
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2008-06-05 15:20:45 +00:00
|
|
|
* @var array
|
|
|
|
* @access public
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
var $belongsTo = array('Image');
|
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-05 15:20:45 +00:00
|
|
|
/**
|
|
|
|
* Image class
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2009-03-18 17:55:58 +00:00
|
|
|
* @package cake
|
2008-10-30 17:30:26 +00:00
|
|
|
* @subpackage cake.tests.cases.libs.model
|
2008-06-05 15:20:45 +00:00
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
class Image extends CakeTestModel {
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-05 15:20:45 +00:00
|
|
|
/**
|
|
|
|
* name property
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2008-06-05 15:20:45 +00:00
|
|
|
* @var string 'Image'
|
|
|
|
* @access public
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
var $name = 'Image';
|
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-05 15:20:45 +00:00
|
|
|
/**
|
|
|
|
* DeviceType class
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2009-03-18 17:55:58 +00:00
|
|
|
* @package cake
|
2008-10-30 17:30:26 +00:00
|
|
|
* @subpackage cake.tests.cases.libs.model
|
2008-06-05 15:20:45 +00:00
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
class DeviceType extends CakeTestModel {
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-05 15:20:45 +00:00
|
|
|
/**
|
|
|
|
* name property
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2008-06-05 15:20:45 +00:00
|
|
|
* @var string 'DeviceType'
|
|
|
|
* @access public
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
var $name = 'DeviceType';
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-05 15:20:45 +00:00
|
|
|
/**
|
|
|
|
* order property
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2008-06-05 15:20:45 +00:00
|
|
|
* @var array
|
|
|
|
* @access public
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
var $order = array('DeviceType.order' => 'ASC');
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-05 15:20:45 +00:00
|
|
|
/**
|
|
|
|
* belongsTo property
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2008-06-05 15:20:45 +00:00
|
|
|
* @var array
|
|
|
|
* @access public
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
var $belongsTo = array(
|
|
|
|
'DeviceTypeCategory', 'FeatureSet', 'ExteriorTypeCategory',
|
|
|
|
'Image' => array('className' => 'Document'),
|
|
|
|
'Extra1' => array('className' => 'Document'),
|
|
|
|
'Extra2' => array('className' => 'Document'));
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-05 15:20:45 +00:00
|
|
|
/**
|
|
|
|
* hasMany property
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2008-06-05 15:20:45 +00:00
|
|
|
* @var array
|
|
|
|
* @access public
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
var $hasMany = array('Device' => array('order' => array('Device.id' => 'ASC')));
|
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-05 15:20:45 +00:00
|
|
|
/**
|
|
|
|
* DeviceTypeCategory class
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2009-03-18 17:55:58 +00:00
|
|
|
* @package cake
|
2008-10-30 17:30:26 +00:00
|
|
|
* @subpackage cake.tests.cases.libs.model
|
2008-06-05 15:20:45 +00:00
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
class DeviceTypeCategory extends CakeTestModel {
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-05 15:20:45 +00:00
|
|
|
/**
|
|
|
|
* name property
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2008-06-05 15:20:45 +00:00
|
|
|
* @var string 'DeviceTypeCategory'
|
|
|
|
* @access public
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
var $name = 'DeviceTypeCategory';
|
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-05 15:20:45 +00:00
|
|
|
/**
|
|
|
|
* FeatureSet class
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2009-03-18 17:55:58 +00:00
|
|
|
* @package cake
|
2008-10-30 17:30:26 +00:00
|
|
|
* @subpackage cake.tests.cases.libs.model
|
2008-06-05 15:20:45 +00:00
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
class FeatureSet extends CakeTestModel {
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-05 15:20:45 +00:00
|
|
|
/**
|
|
|
|
* name property
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2008-06-05 15:20:45 +00:00
|
|
|
* @var string 'FeatureSet'
|
|
|
|
* @access public
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
var $name = 'FeatureSet';
|
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-05 15:20:45 +00:00
|
|
|
/**
|
|
|
|
* ExteriorTypeCategory class
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2009-03-18 17:55:58 +00:00
|
|
|
* @package cake
|
2008-10-30 17:30:26 +00:00
|
|
|
* @subpackage cake.tests.cases.libs.model
|
2008-06-05 15:20:45 +00:00
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
class ExteriorTypeCategory extends CakeTestModel {
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-05 15:20:45 +00:00
|
|
|
/**
|
|
|
|
* name property
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2008-06-05 15:20:45 +00:00
|
|
|
* @var string 'ExteriorTypeCategory'
|
|
|
|
* @access public
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
var $name = 'ExteriorTypeCategory';
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-05 15:20:45 +00:00
|
|
|
/**
|
|
|
|
* belongsTo property
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2008-06-05 15:20:45 +00:00
|
|
|
* @var array
|
|
|
|
* @access public
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
var $belongsTo = array('Image' => array('className' => 'Device'));
|
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-05 15:20:45 +00:00
|
|
|
/**
|
|
|
|
* Document class
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2009-03-18 17:55:58 +00:00
|
|
|
* @package cake
|
2008-10-30 17:30:26 +00:00
|
|
|
* @subpackage cake.tests.cases.libs.model
|
2008-06-05 15:20:45 +00:00
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
class Document extends CakeTestModel {
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-05 15:20:45 +00:00
|
|
|
/**
|
|
|
|
* name property
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2008-06-05 15:20:45 +00:00
|
|
|
* @var string 'Document'
|
|
|
|
* @access public
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
var $name = 'Document';
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-05 15:20:45 +00:00
|
|
|
/**
|
|
|
|
* belongsTo property
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2008-06-05 15:20:45 +00:00
|
|
|
* @var array
|
|
|
|
* @access public
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
var $belongsTo = array('DocumentDirectory');
|
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-05 15:20:45 +00:00
|
|
|
/**
|
|
|
|
* Device class
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2009-03-18 17:55:58 +00:00
|
|
|
* @package cake
|
2008-10-30 17:30:26 +00:00
|
|
|
* @subpackage cake.tests.cases.libs.model
|
2008-06-05 15:20:45 +00:00
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
class Device extends CakeTestModel {
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-05 15:20:45 +00:00
|
|
|
/**
|
|
|
|
* name property
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2008-06-05 15:20:45 +00:00
|
|
|
* @var string 'Device'
|
|
|
|
* @access public
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
var $name = 'Device';
|
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-05 15:20:45 +00:00
|
|
|
/**
|
|
|
|
* DocumentDirectory class
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2009-03-18 17:55:58 +00:00
|
|
|
* @package cake
|
2008-10-30 17:30:26 +00:00
|
|
|
* @subpackage cake.tests.cases.libs.model
|
2008-06-05 15:20:45 +00:00
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
class DocumentDirectory extends CakeTestModel {
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-05 15:20:45 +00:00
|
|
|
/**
|
|
|
|
* name property
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2008-06-05 15:20:45 +00:00
|
|
|
* @var string 'DocumentDirectory'
|
|
|
|
* @access public
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
var $name = 'DocumentDirectory';
|
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-05 15:20:45 +00:00
|
|
|
/**
|
|
|
|
* PrimaryModel class
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2009-03-18 17:55:58 +00:00
|
|
|
* @package cake
|
2008-10-30 17:30:26 +00:00
|
|
|
* @subpackage cake.tests.cases.libs.model
|
2008-06-05 15:20:45 +00:00
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
class PrimaryModel extends CakeTestModel {
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-05 15:20:45 +00:00
|
|
|
/**
|
|
|
|
* name property
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2008-06-05 15:20:45 +00:00
|
|
|
* @var string 'PrimaryModel'
|
|
|
|
* @access public
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
var $name = 'PrimaryModel';
|
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-05 15:20:45 +00:00
|
|
|
/**
|
|
|
|
* SecondaryModel class
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2009-03-18 17:55:58 +00:00
|
|
|
* @package cake
|
2008-10-30 17:30:26 +00:00
|
|
|
* @subpackage cake.tests.cases.libs.model
|
2008-06-05 15:20:45 +00:00
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
class SecondaryModel extends CakeTestModel {
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-05 15:20:45 +00:00
|
|
|
/**
|
|
|
|
* name property
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2008-06-05 15:20:45 +00:00
|
|
|
* @var string 'SecondaryModel'
|
|
|
|
* @access public
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
var $name = 'SecondaryModel';
|
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-05 15:20:45 +00:00
|
|
|
/**
|
|
|
|
* JoinA class
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2009-03-18 17:55:58 +00:00
|
|
|
* @package cake
|
2008-10-30 17:30:26 +00:00
|
|
|
* @subpackage cake.tests.cases.libs.model
|
2008-06-05 15:20:45 +00:00
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
class JoinA extends CakeTestModel {
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-05 15:20:45 +00:00
|
|
|
/**
|
|
|
|
* name property
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2008-06-05 15:20:45 +00:00
|
|
|
* @var string 'JoinA'
|
|
|
|
* @access public
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
var $name = 'JoinA';
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-05 15:20:45 +00:00
|
|
|
/**
|
|
|
|
* hasAndBelongsToMany property
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2008-06-05 15:20:45 +00:00
|
|
|
* @var array
|
|
|
|
* @access public
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
var $hasAndBelongsToMany = array('JoinB', 'JoinC');
|
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-05 15:20:45 +00:00
|
|
|
/**
|
|
|
|
* JoinB class
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2009-03-18 17:55:58 +00:00
|
|
|
* @package cake
|
2008-10-30 17:30:26 +00:00
|
|
|
* @subpackage cake.tests.cases.libs.model
|
2008-06-05 15:20:45 +00:00
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
class JoinB extends CakeTestModel {
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-05 15:20:45 +00:00
|
|
|
/**
|
|
|
|
* name property
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2008-06-05 15:20:45 +00:00
|
|
|
* @var string 'JoinB'
|
|
|
|
* @access public
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
var $name = 'JoinB';
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-05 15:20:45 +00:00
|
|
|
/**
|
|
|
|
* hasAndBelongsToMany property
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2008-06-05 15:20:45 +00:00
|
|
|
* @var array
|
|
|
|
* @access public
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
var $hasAndBelongsToMany = array('JoinA');
|
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-05 15:20:45 +00:00
|
|
|
/**
|
|
|
|
* JoinC class
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2009-03-18 17:55:58 +00:00
|
|
|
* @package cake
|
2008-10-30 17:30:26 +00:00
|
|
|
* @subpackage cake.tests.cases.libs.model
|
2008-06-05 15:20:45 +00:00
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
class JoinC extends CakeTestModel {
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-05 15:20:45 +00:00
|
|
|
/**
|
|
|
|
* name property
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2008-06-05 15:20:45 +00:00
|
|
|
* @var string 'JoinC'
|
|
|
|
* @access public
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
var $name = 'JoinC';
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-05 15:20:45 +00:00
|
|
|
/**
|
|
|
|
* hasAndBelongsToMany property
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2008-06-05 15:20:45 +00:00
|
|
|
* @var array
|
|
|
|
* @access public
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
var $hasAndBelongsToMany = array('JoinA');
|
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-05 15:20:45 +00:00
|
|
|
/**
|
|
|
|
* ThePaper class
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2009-03-18 17:55:58 +00:00
|
|
|
* @package cake
|
2008-10-30 17:30:26 +00:00
|
|
|
* @subpackage cake.tests.cases.libs.model
|
2008-06-05 15:20:45 +00:00
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
class ThePaper extends CakeTestModel {
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-05 15:20:45 +00:00
|
|
|
/**
|
|
|
|
* name property
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2008-06-05 15:20:45 +00:00
|
|
|
* @var string 'ThePaper'
|
|
|
|
* @access public
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
var $name = 'ThePaper';
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-05 15:20:45 +00:00
|
|
|
/**
|
|
|
|
* useTable property
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2008-06-05 15:20:45 +00:00
|
|
|
* @var string 'apples'
|
|
|
|
* @access public
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
var $useTable = 'apples';
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-05 15:20:45 +00:00
|
|
|
/**
|
|
|
|
* hasOne property
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2008-06-05 15:20:45 +00:00
|
|
|
* @var array
|
|
|
|
* @access public
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
var $hasOne = array('Itself' => array('className' => 'ThePaper', 'foreignKey' => 'apple_id'));
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-05 15:20:45 +00:00
|
|
|
/**
|
|
|
|
* hasAndBelongsToMany property
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2008-06-05 15:20:45 +00:00
|
|
|
* @var array
|
|
|
|
* @access public
|
|
|
|
*/
|
2008-12-08 20:05:12 +00:00
|
|
|
var $hasAndBelongsToMany = array('Monkey' => array('joinTable' => 'the_paper_monkies', 'order' => 'id'));
|
2008-05-30 11:40:08 +00:00
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-05 15:20:45 +00:00
|
|
|
/**
|
|
|
|
* Monkey class
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2009-03-18 17:55:58 +00:00
|
|
|
* @package cake
|
2008-10-30 17:30:26 +00:00
|
|
|
* @subpackage cake.tests.cases.libs.model
|
2008-06-05 15:20:45 +00:00
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
class Monkey extends CakeTestModel {
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-05 15:20:45 +00:00
|
|
|
/**
|
|
|
|
* name property
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2008-06-05 15:20:45 +00:00
|
|
|
* @var string 'Monkey'
|
|
|
|
* @access public
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
var $name = 'Monkey';
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-05 15:20:45 +00:00
|
|
|
/**
|
|
|
|
* useTable property
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2008-06-05 15:20:45 +00:00
|
|
|
* @var string 'devices'
|
|
|
|
* @access public
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
var $useTable = 'devices';
|
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-05-30 11:40:08 +00:00
|
|
|
/**
|
2008-08-05 03:22:25 +00:00
|
|
|
* AssociationTest1 class
|
2008-05-30 11:40:08 +00:00
|
|
|
*
|
2009-03-18 17:55:58 +00:00
|
|
|
* @package cake
|
2008-10-30 17:30:26 +00:00
|
|
|
* @subpackage cake.tests.cases.libs.model
|
2008-05-30 11:40:08 +00:00
|
|
|
*/
|
|
|
|
class AssociationTest1 extends CakeTestModel {
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-05 15:20:45 +00:00
|
|
|
/**
|
|
|
|
* useTable property
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2008-06-05 15:20:45 +00:00
|
|
|
* @var string 'join_as'
|
|
|
|
* @access public
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
var $useTable = 'join_as';
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-05 15:20:45 +00:00
|
|
|
/**
|
|
|
|
* name property
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2008-06-05 15:20:45 +00:00
|
|
|
* @var string 'AssociationTest1'
|
|
|
|
* @access public
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
var $name = 'AssociationTest1';
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-05 15:20:45 +00:00
|
|
|
/**
|
|
|
|
* hasAndBelongsToMany property
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2008-06-05 15:20:45 +00:00
|
|
|
* @var array
|
|
|
|
* @access public
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
var $hasAndBelongsToMany = array('AssociationTest2' => array(
|
|
|
|
'unique' => false, 'joinTable' => 'join_as_join_bs', 'foreignKey' => false
|
|
|
|
));
|
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-05-30 11:40:08 +00:00
|
|
|
/**
|
2008-08-05 03:22:25 +00:00
|
|
|
* AssociationTest2 class
|
2008-05-30 11:40:08 +00:00
|
|
|
*
|
2009-03-18 17:55:58 +00:00
|
|
|
* @package cake
|
2008-10-30 17:30:26 +00:00
|
|
|
* @subpackage cake.tests.cases.libs.model
|
2008-05-30 11:40:08 +00:00
|
|
|
*/
|
|
|
|
class AssociationTest2 extends CakeTestModel {
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-05 15:20:45 +00:00
|
|
|
/**
|
|
|
|
* useTable property
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2008-06-05 15:20:45 +00:00
|
|
|
* @var string 'join_bs'
|
|
|
|
* @access public
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
var $useTable = 'join_bs';
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-05 15:20:45 +00:00
|
|
|
/**
|
|
|
|
* name property
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2008-06-05 15:20:45 +00:00
|
|
|
* @var string 'AssociationTest2'
|
|
|
|
* @access public
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
var $name = 'AssociationTest2';
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-05 15:20:45 +00:00
|
|
|
/**
|
|
|
|
* hasAndBelongsToMany property
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2008-06-05 15:20:45 +00:00
|
|
|
* @var array
|
|
|
|
* @access public
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
var $hasAndBelongsToMany = array('AssociationTest1' => array(
|
|
|
|
'unique' => false, 'joinTable' => 'join_as_join_bs'
|
|
|
|
));
|
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-05-30 11:40:08 +00:00
|
|
|
/**
|
2008-08-05 03:22:25 +00:00
|
|
|
* Callback class
|
2008-05-30 11:40:08 +00:00
|
|
|
*
|
2009-03-18 17:55:58 +00:00
|
|
|
* @package cake
|
2008-10-30 17:30:26 +00:00
|
|
|
* @subpackage cake.tests.cases.libs.model
|
2008-05-30 11:40:08 +00:00
|
|
|
*/
|
|
|
|
class Callback extends CakeTestModel {
|
2010-03-17 21:21:20 +00:00
|
|
|
|
2009-11-04 17:36:17 +00:00
|
|
|
}
|
|
|
|
/**
|
|
|
|
* CallbackPostTestModel class
|
|
|
|
*
|
|
|
|
* @package cake
|
|
|
|
* @subpackage cake.tests.cases.libs.model
|
|
|
|
*/
|
|
|
|
class CallbackPostTestModel extends CakeTestModel {
|
|
|
|
var $useTable = 'posts';
|
|
|
|
/**
|
|
|
|
* variable to control return of beforeValidate
|
|
|
|
*
|
|
|
|
* @var string
|
|
|
|
*/
|
|
|
|
var $beforeValidateReturn = true;
|
|
|
|
/**
|
|
|
|
* variable to control return of beforeSave
|
|
|
|
*
|
|
|
|
* @var string
|
|
|
|
*/
|
|
|
|
var $beforeSaveReturn = true;
|
|
|
|
/**
|
|
|
|
* variable to control return of beforeDelete
|
|
|
|
*
|
|
|
|
* @var string
|
|
|
|
*/
|
|
|
|
var $beforeDeleteReturn = true;
|
|
|
|
/**
|
|
|
|
* beforeSave callback
|
|
|
|
*
|
|
|
|
* @return void
|
2009-11-14 12:19:25 +00:00
|
|
|
*/
|
2009-11-04 17:36:17 +00:00
|
|
|
function beforeSave($options) {
|
|
|
|
return $this->beforeSaveReturn;
|
|
|
|
}
|
|
|
|
/**
|
|
|
|
* beforeValidate callback
|
|
|
|
*
|
|
|
|
* @return void
|
2009-11-14 12:19:25 +00:00
|
|
|
*/
|
2009-11-04 17:36:17 +00:00
|
|
|
function beforeValidate($options) {
|
|
|
|
return $this->beforeValidateReturn;
|
|
|
|
}
|
|
|
|
/**
|
|
|
|
* beforeDelete callback
|
|
|
|
*
|
|
|
|
* @return void
|
2009-11-14 12:19:25 +00:00
|
|
|
*/
|
2009-11-04 17:36:17 +00:00
|
|
|
function beforeDelete($cascade = true) {
|
|
|
|
return $this->beforeDeleteReturn;
|
|
|
|
}
|
2008-05-30 11:40:08 +00:00
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-05-30 11:40:08 +00:00
|
|
|
/**
|
2008-08-05 03:22:25 +00:00
|
|
|
* Uuid class
|
2008-05-30 11:40:08 +00:00
|
|
|
*
|
2009-03-18 17:55:58 +00:00
|
|
|
* @package cake
|
2008-10-30 17:30:26 +00:00
|
|
|
* @subpackage cake.tests.cases.libs.model
|
2008-05-30 11:40:08 +00:00
|
|
|
*/
|
|
|
|
class Uuid extends CakeTestModel {
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-05 15:20:45 +00:00
|
|
|
/**
|
|
|
|
* name property
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2008-06-05 15:20:45 +00:00
|
|
|
* @var string 'Uuid'
|
|
|
|
* @access public
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
var $name = 'Uuid';
|
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-05-30 11:40:08 +00:00
|
|
|
/**
|
2008-08-05 03:22:25 +00:00
|
|
|
* DataTest class
|
2008-05-30 11:40:08 +00:00
|
|
|
*
|
2009-03-18 17:55:58 +00:00
|
|
|
* @package cake
|
2008-10-30 17:30:26 +00:00
|
|
|
* @subpackage cake.tests.cases.libs.model
|
2008-05-30 11:40:08 +00:00
|
|
|
*/
|
|
|
|
class DataTest extends CakeTestModel {
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-05 15:20:45 +00:00
|
|
|
/**
|
|
|
|
* name property
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2008-06-05 15:20:45 +00:00
|
|
|
* @var string 'DataTest'
|
|
|
|
* @access public
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
var $name = 'DataTest';
|
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-05-30 11:40:08 +00:00
|
|
|
/**
|
2008-08-05 03:22:25 +00:00
|
|
|
* TheVoid class
|
2008-05-30 11:40:08 +00:00
|
|
|
*
|
2009-03-18 17:55:58 +00:00
|
|
|
* @package cake
|
2008-10-30 17:30:26 +00:00
|
|
|
* @subpackage cake.tests.cases.libs.model
|
2008-05-30 11:40:08 +00:00
|
|
|
*/
|
|
|
|
class TheVoid extends CakeTestModel {
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-05 15:20:45 +00:00
|
|
|
/**
|
|
|
|
* name property
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2008-06-05 15:20:45 +00:00
|
|
|
* @var string 'TheVoid'
|
|
|
|
* @access public
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
var $name = 'TheVoid';
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-05 15:20:45 +00:00
|
|
|
/**
|
|
|
|
* useTable property
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2008-06-05 15:20:45 +00:00
|
|
|
* @var bool false
|
|
|
|
* @access public
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
var $useTable = false;
|
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-05-30 11:40:08 +00:00
|
|
|
/**
|
2009-03-21 23:55:39 +00:00
|
|
|
* ValidationTest1 class
|
2008-05-30 11:40:08 +00:00
|
|
|
*
|
2009-03-18 17:55:58 +00:00
|
|
|
* @package cake
|
2008-10-30 17:30:26 +00:00
|
|
|
* @subpackage cake.tests.cases.libs.model
|
2008-05-30 11:40:08 +00:00
|
|
|
*/
|
2009-03-21 23:55:39 +00:00
|
|
|
class ValidationTest1 extends CakeTestModel {
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-05 15:20:45 +00:00
|
|
|
/**
|
|
|
|
* name property
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2008-06-05 15:20:45 +00:00
|
|
|
* @var string 'ValidationTest'
|
|
|
|
* @access public
|
|
|
|
*/
|
2009-03-21 23:55:39 +00:00
|
|
|
var $name = 'ValidationTest1';
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-05 15:20:45 +00:00
|
|
|
/**
|
|
|
|
* useTable property
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2008-06-05 15:20:45 +00:00
|
|
|
* @var bool false
|
|
|
|
* @access public
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
var $useTable = false;
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-05 15:20:45 +00:00
|
|
|
/**
|
|
|
|
* schema property
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2008-06-05 15:20:45 +00:00
|
|
|
* @var array
|
|
|
|
* @access protected
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
var $_schema = array();
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-05 15:20:45 +00:00
|
|
|
/**
|
|
|
|
* validate property
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2008-06-05 15:20:45 +00:00
|
|
|
* @var array
|
|
|
|
* @access public
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
var $validate = array(
|
2009-01-15 01:55:31 +00:00
|
|
|
'title' => 'notEmpty',
|
2008-05-30 11:40:08 +00:00
|
|
|
'published' => 'customValidationMethod',
|
|
|
|
'body' => array(
|
2009-01-15 01:55:31 +00:00
|
|
|
'notEmpty',
|
2008-05-30 11:40:08 +00:00
|
|
|
'/^.{5,}$/s' => 'no matchy',
|
|
|
|
'/^[0-9A-Za-z \\.]{1,}$/s'
|
|
|
|
)
|
|
|
|
);
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-05 15:20:45 +00:00
|
|
|
/**
|
|
|
|
* customValidationMethod method
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
|
|
|
* @param mixed $data
|
2008-06-05 15:20:45 +00:00
|
|
|
* @access public
|
|
|
|
* @return void
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
function customValidationMethod($data) {
|
|
|
|
return $data === 1;
|
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-08-01 06:28:59 +00:00
|
|
|
/**
|
|
|
|
* Custom validator with parameters + default values
|
|
|
|
*
|
|
|
|
* @access public
|
|
|
|
* @return array
|
|
|
|
*/
|
|
|
|
function customValidatorWithParams($data, $validator, $or = true, $ignore_on_same = 'id') {
|
|
|
|
$this->validatorParams = get_defined_vars();
|
2009-06-27 15:25:07 +00:00
|
|
|
unset($this->validatorParams['this']);
|
2008-08-01 06:28:59 +00:00
|
|
|
return true;
|
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-08-01 06:28:59 +00:00
|
|
|
/**
|
|
|
|
* Custom validator with messaage
|
|
|
|
*
|
|
|
|
* @access public
|
|
|
|
* @return array
|
|
|
|
*/
|
|
|
|
function customValidatorWithMessage($data) {
|
|
|
|
return 'This field will *never* validate! Muhahaha!';
|
|
|
|
}
|
2010-01-02 04:34:11 +00:00
|
|
|
/**
|
|
|
|
* Test validation with many parameters
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
function customValidatorWithSixParams($data, $one = 1, $two = 2, $three = 3, $four = 4, $five = 5, $six = 6) {
|
|
|
|
$this->validatorParams = get_defined_vars();
|
|
|
|
unset($this->validatorParams['this']);
|
|
|
|
return true;
|
|
|
|
}
|
2008-05-30 11:40:08 +00:00
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-05-30 11:40:08 +00:00
|
|
|
/**
|
2008-08-05 03:22:25 +00:00
|
|
|
* ValidationTest2 class
|
2008-05-30 11:40:08 +00:00
|
|
|
*
|
2009-03-18 17:55:58 +00:00
|
|
|
* @package cake
|
2008-10-30 17:30:26 +00:00
|
|
|
* @subpackage cake.tests.cases.libs.model
|
2008-05-30 11:40:08 +00:00
|
|
|
*/
|
|
|
|
class ValidationTest2 extends CakeTestModel {
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-05 15:20:45 +00:00
|
|
|
/**
|
|
|
|
* name property
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2008-06-05 15:20:45 +00:00
|
|
|
* @var string 'ValidationTest2'
|
|
|
|
* @access public
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
var $name = 'ValidationTest2';
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-05 15:20:45 +00:00
|
|
|
/**
|
|
|
|
* useTable property
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2008-06-05 15:20:45 +00:00
|
|
|
* @var bool false
|
|
|
|
* @access public
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
var $useTable = false;
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-05 15:20:45 +00:00
|
|
|
/**
|
|
|
|
* validate property
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2008-06-05 15:20:45 +00:00
|
|
|
* @var array
|
|
|
|
* @access public
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
var $validate = array(
|
2009-01-15 01:55:31 +00:00
|
|
|
'title' => 'notEmpty',
|
2008-05-30 11:40:08 +00:00
|
|
|
'published' => 'customValidationMethod',
|
|
|
|
'body' => array(
|
2009-01-15 01:55:31 +00:00
|
|
|
'notEmpty',
|
2008-05-30 11:40:08 +00:00
|
|
|
'/^.{5,}$/s' => 'no matchy',
|
|
|
|
'/^[0-9A-Za-z \\.]{1,}$/s'
|
|
|
|
)
|
|
|
|
);
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-05 15:20:45 +00:00
|
|
|
/**
|
|
|
|
* customValidationMethod method
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
|
|
|
* @param mixed $data
|
2008-06-05 15:20:45 +00:00
|
|
|
* @access public
|
|
|
|
* @return void
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
function customValidationMethod($data) {
|
|
|
|
return $data === 1;
|
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-05 15:20:45 +00:00
|
|
|
/**
|
|
|
|
* schema method
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2008-06-05 15:20:45 +00:00
|
|
|
* @access public
|
|
|
|
* @return void
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
function schema() {
|
|
|
|
return array();
|
|
|
|
}
|
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-05-30 11:40:08 +00:00
|
|
|
/**
|
2008-08-05 03:22:25 +00:00
|
|
|
* Person class
|
2008-05-30 11:40:08 +00:00
|
|
|
*
|
2009-03-18 17:55:58 +00:00
|
|
|
* @package cake
|
2008-10-30 17:30:26 +00:00
|
|
|
* @subpackage cake.tests.cases.libs.model
|
2008-05-30 11:40:08 +00:00
|
|
|
*/
|
|
|
|
class Person extends CakeTestModel {
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-05 15:20:45 +00:00
|
|
|
/**
|
|
|
|
* name property
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2008-06-05 15:20:45 +00:00
|
|
|
* @var string 'Person'
|
|
|
|
* @access public
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
var $name = 'Person';
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-05 15:20:45 +00:00
|
|
|
/**
|
|
|
|
* belongsTo property
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2008-06-05 15:20:45 +00:00
|
|
|
* @var array
|
|
|
|
* @access public
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
var $belongsTo = array(
|
|
|
|
'Mother' => array(
|
|
|
|
'className' => 'Person',
|
|
|
|
'foreignKey' => 'mother_id'),
|
|
|
|
'Father' => array(
|
|
|
|
'className' => 'Person',
|
|
|
|
'foreignKey' => 'father_id'));
|
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-01 21:04:30 +00:00
|
|
|
/**
|
2008-08-05 03:22:25 +00:00
|
|
|
* UnderscoreField class
|
2008-06-01 21:04:30 +00:00
|
|
|
*
|
2009-03-18 17:55:58 +00:00
|
|
|
* @package cake
|
2008-10-30 17:30:26 +00:00
|
|
|
* @subpackage cake.tests.cases.libs.model
|
2008-06-01 21:04:30 +00:00
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
class UnderscoreField extends CakeTestModel {
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-05 15:20:45 +00:00
|
|
|
/**
|
|
|
|
* name property
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2008-06-05 15:20:45 +00:00
|
|
|
* @var string 'UnderscoreField'
|
|
|
|
* @access public
|
|
|
|
*/
|
2008-06-16 03:11:32 +00:00
|
|
|
var $name = 'UnderscoreField';
|
2008-05-30 11:40:08 +00:00
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-01 21:04:30 +00:00
|
|
|
/**
|
2008-08-05 03:22:25 +00:00
|
|
|
* Product class
|
2008-06-01 21:04:30 +00:00
|
|
|
*
|
2009-03-18 17:55:58 +00:00
|
|
|
* @package cake
|
2008-10-30 17:30:26 +00:00
|
|
|
* @subpackage cake.tests.cases.libs.model
|
2008-06-01 21:04:30 +00:00
|
|
|
*/
|
2008-06-01 18:26:25 +00:00
|
|
|
class Product extends CakeTestModel {
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-05 15:20:45 +00:00
|
|
|
/**
|
|
|
|
* name property
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2008-06-05 15:20:45 +00:00
|
|
|
* @var string 'Product'
|
|
|
|
* @access public
|
|
|
|
*/
|
2008-06-20 20:17:23 +00:00
|
|
|
var $name = 'Product';
|
2008-06-01 18:26:25 +00:00
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-01 21:04:30 +00:00
|
|
|
/**
|
2008-08-05 03:22:25 +00:00
|
|
|
* Story class
|
2008-06-01 21:04:30 +00:00
|
|
|
*
|
2009-03-18 17:55:58 +00:00
|
|
|
* @package cake
|
2008-10-30 17:30:26 +00:00
|
|
|
* @subpackage cake.tests.cases.libs.model
|
2008-06-01 21:04:30 +00:00
|
|
|
*/
|
|
|
|
class Story extends CakeTestModel {
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-05 15:20:45 +00:00
|
|
|
/**
|
|
|
|
* name property
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2008-06-05 15:20:45 +00:00
|
|
|
* @var string 'Story'
|
|
|
|
* @access public
|
|
|
|
*/
|
2008-06-01 21:04:30 +00:00
|
|
|
var $name = 'Story';
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-05 15:20:45 +00:00
|
|
|
/**
|
|
|
|
* primaryKey property
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2008-06-05 15:20:45 +00:00
|
|
|
* @var string 'story'
|
|
|
|
* @access public
|
|
|
|
*/
|
2008-06-01 21:04:30 +00:00
|
|
|
var $primaryKey = 'story';
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-05 15:20:45 +00:00
|
|
|
/**
|
|
|
|
* hasAndBelongsToMany property
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2008-06-05 15:20:45 +00:00
|
|
|
* @var array
|
|
|
|
* @access public
|
|
|
|
*/
|
2008-06-01 21:04:30 +00:00
|
|
|
var $hasAndBelongsToMany = array('Tag' => array('foreignKey' => 'story'));
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-05 15:20:45 +00:00
|
|
|
/**
|
|
|
|
* validate property
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2008-06-05 15:20:45 +00:00
|
|
|
* @var array
|
|
|
|
* @access public
|
|
|
|
*/
|
2009-01-15 01:55:31 +00:00
|
|
|
var $validate = array('title' => 'notEmpty');
|
2008-06-01 21:04:30 +00:00
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-16 03:11:32 +00:00
|
|
|
/**
|
2008-08-05 03:22:25 +00:00
|
|
|
* Cd class
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2009-03-18 17:55:58 +00:00
|
|
|
* @package cake
|
2008-10-30 17:30:26 +00:00
|
|
|
* @subpackage cake.tests.cases.libs.model
|
2008-06-16 03:11:32 +00:00
|
|
|
*/
|
|
|
|
class Cd extends CakeTestModel {
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-16 03:11:32 +00:00
|
|
|
/**
|
|
|
|
* name property
|
|
|
|
*
|
|
|
|
* @var string 'Cd'
|
|
|
|
* @access public
|
|
|
|
*/
|
|
|
|
var $name = 'Cd';
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-16 03:11:32 +00:00
|
|
|
/**
|
|
|
|
* hasOne property
|
|
|
|
*
|
|
|
|
* @var array
|
|
|
|
* @access public
|
|
|
|
*/
|
|
|
|
var $hasOne = array('OverallFavorite' => array('foreignKey' => 'model_id', 'dependent' => true, 'conditions' => array('model_type' => 'Cd')));
|
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-16 03:11:32 +00:00
|
|
|
/**
|
2008-08-05 03:22:25 +00:00
|
|
|
* Book class
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2009-03-18 17:55:58 +00:00
|
|
|
* @package cake
|
2008-10-30 17:30:26 +00:00
|
|
|
* @subpackage cake.tests.cases.libs.model
|
2008-06-16 03:11:32 +00:00
|
|
|
*/
|
|
|
|
class Book extends CakeTestModel {
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-16 03:11:32 +00:00
|
|
|
/**
|
|
|
|
* name property
|
|
|
|
*
|
|
|
|
* @var string 'Book'
|
|
|
|
* @access public
|
|
|
|
*/
|
|
|
|
var $name = 'Book';
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-16 03:11:32 +00:00
|
|
|
/**
|
|
|
|
* hasOne property
|
|
|
|
*
|
|
|
|
* @var array
|
|
|
|
* @access public
|
|
|
|
*/
|
2010-03-17 21:21:20 +00:00
|
|
|
var $hasOne = array('OverallFavorite' => array('foreignKey' => 'model_id', 'dependent' => true, 'conditions' => 'OverallFavorite.model_type = \'Book\''));
|
2008-06-16 03:11:32 +00:00
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-16 03:11:32 +00:00
|
|
|
/**
|
2008-08-05 03:22:25 +00:00
|
|
|
* OverallFavorite class
|
2008-06-16 03:11:32 +00:00
|
|
|
*
|
2009-03-18 17:55:58 +00:00
|
|
|
* @package cake
|
2008-10-30 17:30:26 +00:00
|
|
|
* @subpackage cake.tests.cases.libs.model
|
2008-06-16 03:11:32 +00:00
|
|
|
*/
|
|
|
|
class OverallFavorite extends CakeTestModel {
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-16 03:11:32 +00:00
|
|
|
/**
|
|
|
|
* name property
|
|
|
|
*
|
|
|
|
* @var string 'OverallFavorite'
|
|
|
|
* @access public
|
|
|
|
*/
|
|
|
|
var $name = 'OverallFavorite';
|
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-22 15:18:30 +00:00
|
|
|
/**
|
2008-08-05 03:22:25 +00:00
|
|
|
* MyUser class
|
2008-06-22 15:18:30 +00:00
|
|
|
*
|
2009-03-18 17:55:58 +00:00
|
|
|
* @package cake
|
2008-10-30 17:30:26 +00:00
|
|
|
* @subpackage cake.tests.cases.libs.model
|
2008-06-22 15:18:30 +00:00
|
|
|
*/
|
|
|
|
class MyUser extends CakeTestModel {
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-22 15:18:30 +00:00
|
|
|
/**
|
|
|
|
* name property
|
|
|
|
*
|
|
|
|
* @var string 'MyUser'
|
|
|
|
* @access public
|
|
|
|
*/
|
|
|
|
var $name = 'MyUser';
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-22 15:18:30 +00:00
|
|
|
/**
|
|
|
|
* undocumented variable
|
|
|
|
*
|
|
|
|
* @var string
|
|
|
|
* @access public
|
|
|
|
*/
|
|
|
|
var $hasAndBelongsToMany = array('MyCategory');
|
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-22 15:18:30 +00:00
|
|
|
/**
|
2008-08-05 03:22:25 +00:00
|
|
|
* MyCategory class
|
2008-06-22 15:18:30 +00:00
|
|
|
*
|
2009-03-18 17:55:58 +00:00
|
|
|
* @package cake
|
2008-10-30 17:30:26 +00:00
|
|
|
* @subpackage cake.tests.cases.libs.model
|
2008-06-22 15:18:30 +00:00
|
|
|
*/
|
|
|
|
class MyCategory extends CakeTestModel {
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-22 15:18:30 +00:00
|
|
|
/**
|
|
|
|
* name property
|
|
|
|
*
|
|
|
|
* @var string 'MyCategory'
|
|
|
|
* @access public
|
|
|
|
*/
|
|
|
|
var $name = 'MyCategory';
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-22 15:18:30 +00:00
|
|
|
/**
|
|
|
|
* undocumented variable
|
|
|
|
*
|
|
|
|
* @var string
|
|
|
|
* @access public
|
|
|
|
*/
|
|
|
|
var $hasAndBelongsToMany = array('MyProduct', 'MyUser');
|
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-22 15:18:30 +00:00
|
|
|
/**
|
2008-08-05 03:22:25 +00:00
|
|
|
* MyProduct class
|
2008-06-22 15:18:30 +00:00
|
|
|
*
|
2009-03-18 17:55:58 +00:00
|
|
|
* @package cake
|
2008-10-30 17:30:26 +00:00
|
|
|
* @subpackage cake.tests.cases.libs.model
|
2008-06-22 15:18:30 +00:00
|
|
|
*/
|
|
|
|
class MyProduct extends CakeTestModel {
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-22 15:18:30 +00:00
|
|
|
/**
|
|
|
|
* name property
|
|
|
|
*
|
|
|
|
* @var string 'MyProduct'
|
|
|
|
* @access public
|
|
|
|
*/
|
|
|
|
var $name = 'MyProduct';
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-22 15:18:30 +00:00
|
|
|
/**
|
|
|
|
* undocumented variable
|
|
|
|
*
|
|
|
|
* @var string
|
|
|
|
* @access public
|
|
|
|
*/
|
|
|
|
var $hasAndBelongsToMany = array('MyCategory');
|
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-22 15:18:30 +00:00
|
|
|
/**
|
2008-08-05 03:22:25 +00:00
|
|
|
* MyCategoriesMyUser class
|
2008-06-22 15:18:30 +00:00
|
|
|
*
|
2009-03-18 17:55:58 +00:00
|
|
|
* @package cake
|
2008-10-30 17:30:26 +00:00
|
|
|
* @subpackage cake.tests.cases.libs.model
|
2008-06-22 15:18:30 +00:00
|
|
|
*/
|
|
|
|
class MyCategoriesMyUser extends CakeTestModel {
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-22 15:18:30 +00:00
|
|
|
/**
|
|
|
|
* name property
|
|
|
|
*
|
|
|
|
* @var string 'MyCategoriesMyUser'
|
|
|
|
* @access public
|
|
|
|
*/
|
|
|
|
var $name = 'MyCategoriesMyUser';
|
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-22 15:18:30 +00:00
|
|
|
/**
|
2008-08-05 03:22:25 +00:00
|
|
|
* MyCategoriesMyProduct class
|
2008-06-22 15:18:30 +00:00
|
|
|
*
|
2009-03-18 17:55:58 +00:00
|
|
|
* @package cake
|
2008-10-30 17:30:26 +00:00
|
|
|
* @subpackage cake.tests.cases.libs.model
|
2008-06-22 15:18:30 +00:00
|
|
|
*/
|
|
|
|
class MyCategoriesMyProduct extends CakeTestModel {
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-22 15:18:30 +00:00
|
|
|
/**
|
|
|
|
* name property
|
|
|
|
*
|
|
|
|
* @var string 'MyCategoriesMyProduct'
|
|
|
|
* @access public
|
|
|
|
*/
|
|
|
|
var $name = 'MyCategoriesMyProduct';
|
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-24 03:16:28 +00:00
|
|
|
/**
|
|
|
|
* I18nModel class
|
|
|
|
*
|
2009-03-18 17:55:58 +00:00
|
|
|
* @package cake
|
2008-10-30 17:30:26 +00:00
|
|
|
* @subpackage cake.tests.cases.libs.model
|
2008-06-24 03:16:28 +00:00
|
|
|
*/
|
|
|
|
class I18nModel extends CakeTestModel {
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-24 03:16:28 +00:00
|
|
|
/**
|
|
|
|
* name property
|
|
|
|
*
|
|
|
|
* @var string 'I18nModel'
|
|
|
|
* @access public
|
|
|
|
*/
|
|
|
|
var $name = 'I18nModel';
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-24 03:16:28 +00:00
|
|
|
/**
|
|
|
|
* useTable property
|
|
|
|
*
|
|
|
|
* @var string 'i18n'
|
|
|
|
* @access public
|
|
|
|
*/
|
|
|
|
var $useTable = 'i18n';
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-24 03:16:28 +00:00
|
|
|
/**
|
|
|
|
* displayField property
|
|
|
|
*
|
|
|
|
* @var string 'field'
|
|
|
|
* @access public
|
|
|
|
*/
|
|
|
|
var $displayField = 'field';
|
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-24 03:16:28 +00:00
|
|
|
/**
|
|
|
|
* NumberTree class
|
|
|
|
*
|
2009-03-18 17:55:58 +00:00
|
|
|
* @package cake
|
2008-10-30 17:30:26 +00:00
|
|
|
* @subpackage cake.tests.cases.libs.model
|
2008-06-24 03:16:28 +00:00
|
|
|
*/
|
|
|
|
class NumberTree extends CakeTestModel {
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-24 03:16:28 +00:00
|
|
|
/**
|
|
|
|
* name property
|
|
|
|
*
|
|
|
|
* @var string 'NumberTree'
|
|
|
|
* @access public
|
|
|
|
*/
|
|
|
|
var $name = 'NumberTree';
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-24 03:16:28 +00:00
|
|
|
/**
|
|
|
|
* actsAs property
|
|
|
|
*
|
|
|
|
* @var array
|
|
|
|
* @access public
|
|
|
|
*/
|
|
|
|
var $actsAs = array('Tree');
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-24 03:16:28 +00:00
|
|
|
/**
|
|
|
|
* initialize method
|
|
|
|
*
|
|
|
|
* @param int $levelLimit
|
|
|
|
* @param int $childLimit
|
|
|
|
* @param mixed $currentLevel
|
|
|
|
* @param mixed $parent_id
|
|
|
|
* @param string $prefix
|
|
|
|
* @param bool $hierachial
|
|
|
|
* @access public
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
function initialize($levelLimit = 3, $childLimit = 3, $currentLevel = null, $parent_id = null, $prefix = '1', $hierachial = true) {
|
|
|
|
if (!$parent_id) {
|
2008-11-20 13:57:44 +00:00
|
|
|
$db =& ConnectionManager::getDataSource($this->useDbConfig);
|
|
|
|
$db->truncate($this->table);
|
2008-06-24 03:16:28 +00:00
|
|
|
$this->save(array($this->name => array('name' => '1. Root')));
|
|
|
|
$this->initialize($levelLimit, $childLimit, 1, $this->id, '1', $hierachial);
|
|
|
|
$this->create(array());
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!$currentLevel || $currentLevel > $levelLimit) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
for ($i = 1; $i <= $childLimit; $i++) {
|
|
|
|
$name = $prefix . '.' . $i;
|
|
|
|
$data = array($this->name => array('name' => $name));
|
|
|
|
$this->create($data);
|
|
|
|
|
|
|
|
if ($hierachial) {
|
2008-11-20 13:57:44 +00:00
|
|
|
if ($this->name == 'UnconventionalTree') {
|
|
|
|
$data[$this->name]['join'] = $parent_id;
|
|
|
|
} else {
|
|
|
|
$data[$this->name]['parent_id'] = $parent_id;
|
|
|
|
}
|
2008-06-24 03:16:28 +00:00
|
|
|
}
|
|
|
|
$this->save($data);
|
|
|
|
$this->initialize($levelLimit, $childLimit, $currentLevel + 1, $this->id, $name, $hierachial);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2009-05-26 17:17:57 +00:00
|
|
|
/**
|
|
|
|
* NumberTreeTwo class
|
|
|
|
*
|
|
|
|
* @package cake
|
|
|
|
* @subpackage cake.tests.cases.libs.model
|
|
|
|
*/
|
|
|
|
class NumberTreeTwo extends NumberTree {
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2009-05-26 17:17:57 +00:00
|
|
|
/**
|
|
|
|
* name property
|
|
|
|
*
|
|
|
|
* @var string 'NumberTree'
|
|
|
|
* @access public
|
|
|
|
*/
|
|
|
|
var $name = 'NumberTreeTwo';
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2009-05-26 17:17:57 +00:00
|
|
|
/**
|
|
|
|
* actsAs property
|
|
|
|
*
|
|
|
|
* @var array
|
|
|
|
* @access public
|
|
|
|
*/
|
|
|
|
var $actsAs = array();
|
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-24 03:16:28 +00:00
|
|
|
/**
|
|
|
|
* FlagTree class
|
|
|
|
*
|
2009-03-18 17:55:58 +00:00
|
|
|
* @package cake
|
2008-10-30 17:30:26 +00:00
|
|
|
* @subpackage cake.tests.cases.libs.model
|
2008-06-24 03:16:28 +00:00
|
|
|
*/
|
|
|
|
class FlagTree extends NumberTree {
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-24 03:16:28 +00:00
|
|
|
/**
|
|
|
|
* name property
|
|
|
|
*
|
|
|
|
* @var string 'FlagTree'
|
|
|
|
* @access public
|
|
|
|
*/
|
|
|
|
var $name = 'FlagTree';
|
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-11-20 13:57:44 +00:00
|
|
|
/**
|
|
|
|
* UnconventionalTree class
|
|
|
|
*
|
2009-03-18 17:55:58 +00:00
|
|
|
* @package cake
|
2008-11-20 13:57:44 +00:00
|
|
|
* @subpackage cake.tests.cases.libs.model
|
|
|
|
*/
|
|
|
|
class UnconventionalTree extends NumberTree {
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-11-20 13:57:44 +00:00
|
|
|
/**
|
|
|
|
* name property
|
|
|
|
*
|
|
|
|
* @var string 'FlagTree'
|
|
|
|
* @access public
|
|
|
|
*/
|
|
|
|
var $name = 'UnconventionalTree';
|
|
|
|
var $actsAs = array(
|
|
|
|
'Tree' => array(
|
|
|
|
'parent' => 'join',
|
|
|
|
'left' => 'left',
|
|
|
|
'right' => 'right'
|
|
|
|
)
|
|
|
|
);
|
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2009-01-14 23:40:47 +00:00
|
|
|
/**
|
|
|
|
* UuidTree class
|
|
|
|
*
|
2009-03-18 17:55:58 +00:00
|
|
|
* @package cake
|
2009-01-14 23:40:47 +00:00
|
|
|
* @subpackage cake.tests.cases.libs.model
|
|
|
|
*/
|
|
|
|
class UuidTree extends NumberTree {
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2009-01-14 23:40:47 +00:00
|
|
|
/**
|
|
|
|
* name property
|
|
|
|
*
|
|
|
|
* @var string 'FlagTree'
|
|
|
|
* @access public
|
|
|
|
*/
|
|
|
|
var $name = 'UuidTree';
|
|
|
|
}
|
|
|
|
|
2008-06-24 03:16:28 +00:00
|
|
|
/**
|
|
|
|
* Campaign class
|
|
|
|
*
|
2009-03-18 17:55:58 +00:00
|
|
|
* @package cake
|
2008-10-30 17:30:26 +00:00
|
|
|
* @subpackage cake.tests.cases.libs.model
|
2008-06-24 03:16:28 +00:00
|
|
|
*/
|
|
|
|
class Campaign extends CakeTestModel {
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-24 03:16:28 +00:00
|
|
|
/**
|
|
|
|
* name property
|
|
|
|
*
|
|
|
|
* @var string 'Campaign'
|
|
|
|
* @access public
|
|
|
|
*/
|
|
|
|
var $name = 'Campaign';
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-24 03:16:28 +00:00
|
|
|
/**
|
|
|
|
* hasMany property
|
|
|
|
*
|
|
|
|
* @var array
|
|
|
|
* @access public
|
|
|
|
*/
|
|
|
|
var $hasMany = array('Ad' => array('fields' => array('id','campaign_id','name')));
|
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-24 03:16:28 +00:00
|
|
|
/**
|
|
|
|
* Ad class
|
|
|
|
*
|
2009-03-18 17:55:58 +00:00
|
|
|
* @package cake
|
2008-10-30 17:30:26 +00:00
|
|
|
* @subpackage cake.tests.cases.libs.model
|
2008-06-24 03:16:28 +00:00
|
|
|
*/
|
|
|
|
class Ad extends CakeTestModel {
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-24 03:16:28 +00:00
|
|
|
/**
|
|
|
|
* name property
|
|
|
|
*
|
|
|
|
* @var string 'Ad'
|
|
|
|
* @access public
|
|
|
|
*/
|
|
|
|
var $name = 'Ad';
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-24 03:16:28 +00:00
|
|
|
/**
|
|
|
|
* actsAs property
|
|
|
|
*
|
|
|
|
* @var array
|
|
|
|
* @access public
|
|
|
|
*/
|
|
|
|
var $actsAs = array('Tree');
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-24 03:16:28 +00:00
|
|
|
/**
|
|
|
|
* belongsTo property
|
|
|
|
*
|
|
|
|
* @var array
|
|
|
|
* @access public
|
|
|
|
*/
|
|
|
|
var $belongsTo = array('Campaign');
|
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-09-09 18:42:18 +00:00
|
|
|
/**
|
2008-09-09 18:48:13 +00:00
|
|
|
* AfterTree class
|
2008-09-09 18:42:18 +00:00
|
|
|
*
|
2009-03-18 17:55:58 +00:00
|
|
|
* @package cake
|
2008-10-30 17:30:26 +00:00
|
|
|
* @subpackage cake.tests.cases.libs.model
|
2008-09-09 18:42:18 +00:00
|
|
|
*/
|
2008-11-20 13:57:44 +00:00
|
|
|
class AfterTree extends NumberTree {
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-09-09 18:42:18 +00:00
|
|
|
/**
|
|
|
|
* name property
|
|
|
|
*
|
|
|
|
* @var string 'AfterTree'
|
|
|
|
* @access public
|
|
|
|
*/
|
|
|
|
var $name = 'AfterTree';
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-09-09 18:42:18 +00:00
|
|
|
/**
|
|
|
|
* actsAs property
|
|
|
|
*
|
|
|
|
* @var array
|
|
|
|
* @access public
|
|
|
|
*/
|
|
|
|
var $actsAs = array('Tree');
|
|
|
|
|
|
|
|
function afterSave($created) {
|
|
|
|
if ($created && isset($this->data['AfterTree'])) {
|
|
|
|
$this->data['AfterTree']['name'] = 'Six and One Half Changed in AfterTree::afterSave() but not in database';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-07-31 15:38:23 +00:00
|
|
|
/**
|
|
|
|
* Nonconformant Content class
|
|
|
|
*
|
2009-03-18 17:55:58 +00:00
|
|
|
* @package cake
|
2008-10-30 17:30:26 +00:00
|
|
|
* @subpackage cake.tests.cases.libs.model
|
2008-07-31 15:38:23 +00:00
|
|
|
*/
|
|
|
|
class Content extends CakeTestModel {
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-07-31 15:38:23 +00:00
|
|
|
/**
|
|
|
|
* name property
|
|
|
|
*
|
|
|
|
* @var string 'Content'
|
|
|
|
* @access public
|
|
|
|
*/
|
|
|
|
var $name = 'Content';
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-07-31 15:38:23 +00:00
|
|
|
/**
|
|
|
|
* useTable property
|
|
|
|
*
|
|
|
|
* @var string 'Content'
|
|
|
|
* @access public
|
|
|
|
*/
|
|
|
|
var $useTable = 'Content';
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-07-31 15:38:23 +00:00
|
|
|
/**
|
|
|
|
* primaryKey property
|
|
|
|
*
|
|
|
|
* @var string 'iContentId'
|
|
|
|
* @access public
|
|
|
|
*/
|
|
|
|
var $primaryKey = 'iContentId';
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-07-31 15:38:23 +00:00
|
|
|
/**
|
|
|
|
* hasAndBelongsToMany property
|
|
|
|
*
|
|
|
|
* @var array
|
|
|
|
* @access public
|
|
|
|
*/
|
2008-10-13 01:17:34 +00:00
|
|
|
var $hasAndBelongsToMany = array('Account' => array('className' => 'Account', 'with' => 'ContentAccount', 'joinTable' => 'ContentAccounts', 'foreignKey' => 'iContentId', 'associationForeignKey', 'iAccountId'));
|
2008-07-31 15:38:23 +00:00
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-07-31 15:38:23 +00:00
|
|
|
/**
|
|
|
|
* Nonconformant Account class
|
|
|
|
*
|
2009-03-18 17:55:58 +00:00
|
|
|
* @package cake
|
2008-10-30 17:30:26 +00:00
|
|
|
* @subpackage cake.tests.cases.libs.model
|
2008-07-31 15:38:23 +00:00
|
|
|
*/
|
|
|
|
class Account extends CakeTestModel {
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-07-31 15:38:23 +00:00
|
|
|
/**
|
|
|
|
* name property
|
|
|
|
*
|
|
|
|
* @var string 'Account'
|
|
|
|
* @access public
|
|
|
|
*/
|
|
|
|
var $name = 'Account';
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-07-31 15:38:23 +00:00
|
|
|
/**
|
|
|
|
* useTable property
|
|
|
|
*
|
|
|
|
* @var string 'Account'
|
|
|
|
* @access public
|
|
|
|
*/
|
|
|
|
var $useTable = 'Accounts';
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-07-31 15:38:23 +00:00
|
|
|
/**
|
|
|
|
* primaryKey property
|
|
|
|
*
|
|
|
|
* @var string 'iAccountId'
|
|
|
|
* @access public
|
|
|
|
*/
|
|
|
|
var $primaryKey = 'iAccountId';
|
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-07-31 15:38:23 +00:00
|
|
|
/**
|
|
|
|
* Nonconformant ContentAccount class
|
|
|
|
*
|
2009-03-18 17:55:58 +00:00
|
|
|
* @package cake
|
2008-10-30 17:30:26 +00:00
|
|
|
* @subpackage cake.tests.cases.libs.model
|
2008-07-31 15:38:23 +00:00
|
|
|
*/
|
|
|
|
class ContentAccount extends CakeTestModel {
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-07-31 15:38:23 +00:00
|
|
|
/**
|
|
|
|
* name property
|
|
|
|
*
|
|
|
|
* @var string 'Account'
|
|
|
|
* @access public
|
|
|
|
*/
|
|
|
|
var $name = 'ContentAccount';
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-07-31 15:38:23 +00:00
|
|
|
/**
|
|
|
|
* useTable property
|
|
|
|
*
|
|
|
|
* @var string 'Account'
|
|
|
|
* @access public
|
|
|
|
*/
|
|
|
|
var $useTable = 'ContentAccounts';
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-07-31 15:38:23 +00:00
|
|
|
/**
|
|
|
|
* primaryKey property
|
|
|
|
*
|
|
|
|
* @var string 'iAccountId'
|
|
|
|
* @access public
|
|
|
|
*/
|
|
|
|
var $primaryKey = 'iContentAccountsId';
|
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-09-22 20:08:31 +00:00
|
|
|
/**
|
|
|
|
* FilmFile class
|
|
|
|
*
|
2009-03-18 17:55:58 +00:00
|
|
|
* @package cake
|
2008-10-30 17:30:26 +00:00
|
|
|
* @subpackage cake.tests.cases.libs.model
|
2008-09-22 20:08:31 +00:00
|
|
|
*/
|
|
|
|
class FilmFile extends CakeTestModel {
|
|
|
|
var $name = 'FilmFile';
|
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-09-22 20:08:31 +00:00
|
|
|
/**
|
|
|
|
* Basket test model
|
|
|
|
*
|
2009-03-18 17:55:58 +00:00
|
|
|
* @package cake
|
2008-10-30 17:30:26 +00:00
|
|
|
* @subpackage cake.tests.cases.libs.model
|
2008-09-22 20:08:31 +00:00
|
|
|
*/
|
|
|
|
class Basket extends CakeTestModel {
|
|
|
|
var $name = 'Basket';
|
|
|
|
|
|
|
|
var $belongsTo = array(
|
|
|
|
'FilmFile' => array(
|
|
|
|
'className' => 'FilmFile',
|
|
|
|
'foreignKey' => 'object_id',
|
2009-06-04 00:37:27 +00:00
|
|
|
'conditions' => "Basket.type = 'file'",
|
2008-09-22 20:08:31 +00:00
|
|
|
'fields' => '',
|
|
|
|
'order' => ''
|
|
|
|
)
|
|
|
|
);
|
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-09-25 00:58:06 +00:00
|
|
|
/**
|
|
|
|
* TestPluginArticle class
|
|
|
|
*
|
2009-03-18 17:55:58 +00:00
|
|
|
* @package cake
|
2008-10-30 17:30:26 +00:00
|
|
|
* @subpackage cake.tests.cases.libs.model
|
2008-09-25 00:58:06 +00:00
|
|
|
*/
|
|
|
|
class TestPluginArticle extends CakeTestModel {
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-09-25 00:58:06 +00:00
|
|
|
/**
|
|
|
|
* name property
|
|
|
|
*
|
|
|
|
* @var string 'TestPluginArticle'
|
|
|
|
* @access public
|
|
|
|
*/
|
|
|
|
var $name = 'TestPluginArticle';
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-09-25 00:58:06 +00:00
|
|
|
/**
|
|
|
|
* belongsTo property
|
|
|
|
*
|
|
|
|
* @var array
|
|
|
|
* @access public
|
|
|
|
*/
|
|
|
|
var $belongsTo = array('User');
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-09-25 00:58:06 +00:00
|
|
|
/**
|
|
|
|
* hasMany property
|
|
|
|
*
|
|
|
|
* @var array
|
|
|
|
* @access public
|
|
|
|
*/
|
|
|
|
var $hasMany = array(
|
|
|
|
'TestPluginComment' => array(
|
|
|
|
'className' => 'TestPlugin.TestPluginComment',
|
|
|
|
'foreignKey' => 'article_id',
|
|
|
|
'dependent' => true
|
|
|
|
)
|
|
|
|
);
|
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-09-25 00:58:06 +00:00
|
|
|
/**
|
|
|
|
* TestPluginComment class
|
|
|
|
*
|
2009-03-18 17:55:58 +00:00
|
|
|
* @package cake
|
2008-10-30 17:30:26 +00:00
|
|
|
* @subpackage cake.tests.cases.libs.model
|
2008-09-25 00:58:06 +00:00
|
|
|
*/
|
|
|
|
class TestPluginComment extends CakeTestModel {
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-09-25 00:58:06 +00:00
|
|
|
/**
|
|
|
|
* name property
|
|
|
|
*
|
|
|
|
* @var string 'TestPluginComment'
|
|
|
|
* @access public
|
|
|
|
*/
|
|
|
|
var $name = 'TestPluginComment';
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-09-25 00:58:06 +00:00
|
|
|
/**
|
|
|
|
* belongsTo property
|
|
|
|
*
|
|
|
|
* @var array
|
|
|
|
* @access public
|
|
|
|
*/
|
|
|
|
var $belongsTo = array(
|
|
|
|
'TestPluginArticle' => array(
|
|
|
|
'className' => 'TestPlugin.TestPluginArticle',
|
|
|
|
'foreignKey' => 'article_id',
|
|
|
|
),
|
|
|
|
'User'
|
|
|
|
);
|
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-10-23 13:29:32 +00:00
|
|
|
/**
|
|
|
|
* Uuidportfolio class
|
|
|
|
*
|
2009-03-18 17:55:58 +00:00
|
|
|
* @package cake
|
2008-10-30 17:30:26 +00:00
|
|
|
* @subpackage cake.tests.cases.libs.model
|
2008-10-23 13:29:32 +00:00
|
|
|
*/
|
|
|
|
class Uuidportfolio extends CakeTestModel {
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-10-23 13:29:32 +00:00
|
|
|
/**
|
|
|
|
* name property
|
|
|
|
*
|
|
|
|
* @var string 'Uuidportfolio'
|
|
|
|
* @access public
|
|
|
|
*/
|
|
|
|
var $name = 'Uuidportfolio';
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-10-23 13:29:32 +00:00
|
|
|
/**
|
|
|
|
* hasAndBelongsToMany property
|
|
|
|
*
|
|
|
|
* @var array
|
|
|
|
* @access public
|
|
|
|
*/
|
|
|
|
var $hasAndBelongsToMany = array('Uuiditem');
|
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-10-23 13:29:32 +00:00
|
|
|
/**
|
|
|
|
* Uuiditem class
|
|
|
|
*
|
2009-03-18 17:55:58 +00:00
|
|
|
* @package cake
|
2008-10-30 17:30:26 +00:00
|
|
|
* @subpackage cake.tests.cases.libs.model
|
2008-10-23 13:29:32 +00:00
|
|
|
*/
|
|
|
|
class Uuiditem extends CakeTestModel {
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-10-23 13:29:32 +00:00
|
|
|
/**
|
|
|
|
* name property
|
|
|
|
*
|
|
|
|
* @var string 'Item'
|
|
|
|
* @access public
|
|
|
|
*/
|
|
|
|
var $name = 'Uuiditem';
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-10-23 13:29:32 +00:00
|
|
|
/**
|
|
|
|
* hasAndBelongsToMany property
|
|
|
|
*
|
|
|
|
* @var array
|
|
|
|
* @access public
|
|
|
|
*/
|
2008-11-09 20:55:51 +00:00
|
|
|
var $hasAndBelongsToMany = array('Uuidportfolio' => array('with' => 'UuiditemsUuidportfolioNumericid'));
|
|
|
|
|
2008-10-23 13:29:32 +00:00
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-10-23 13:29:32 +00:00
|
|
|
/**
|
|
|
|
* UuiditemsPortfolio class
|
|
|
|
*
|
2009-03-18 17:55:58 +00:00
|
|
|
* @package cake
|
2008-10-30 17:30:26 +00:00
|
|
|
* @subpackage cake.tests.cases.libs.model
|
2008-10-23 13:29:32 +00:00
|
|
|
*/
|
|
|
|
class UuiditemsUuidportfolio extends CakeTestModel {
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-10-23 13:29:32 +00:00
|
|
|
/**
|
|
|
|
* name property
|
|
|
|
*
|
|
|
|
* @var string 'ItemsPortfolio'
|
|
|
|
* @access public
|
|
|
|
*/
|
|
|
|
var $name = 'UuiditemsUuidportfolio';
|
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-11-09 20:55:51 +00:00
|
|
|
/**
|
|
|
|
* UuiditemsPortfolioNumericid class
|
|
|
|
*
|
2009-03-18 17:55:58 +00:00
|
|
|
* @package cake
|
2008-11-09 20:55:51 +00:00
|
|
|
* @subpackage cake.tests.cases.libs.model
|
|
|
|
*/
|
|
|
|
class UuiditemsUuidportfolioNumericid extends CakeTestModel {
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-11-09 20:55:51 +00:00
|
|
|
/**
|
|
|
|
* name property
|
|
|
|
*
|
|
|
|
* @var string
|
|
|
|
* @access public
|
|
|
|
*/
|
|
|
|
var $name = 'UuiditemsUuidportfolioNumericid';
|
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-11-03 23:58:44 +00:00
|
|
|
/**
|
|
|
|
* TranslateTestModel class.
|
|
|
|
*
|
2009-03-18 17:55:58 +00:00
|
|
|
* @package cake
|
2008-11-03 23:58:44 +00:00
|
|
|
* @subpackage cake.tests.cases.libs.model
|
|
|
|
*/
|
|
|
|
class TranslateTestModel extends CakeTestModel {
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-11-03 23:58:44 +00:00
|
|
|
/**
|
|
|
|
* name property
|
|
|
|
*
|
|
|
|
* @var string 'TranslateTestModel'
|
|
|
|
* @access public
|
|
|
|
*/
|
|
|
|
var $name = 'TranslateTestModel';
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-11-03 23:58:44 +00:00
|
|
|
/**
|
|
|
|
* useTable property
|
|
|
|
*
|
|
|
|
* @var string 'i18n'
|
|
|
|
* @access public
|
|
|
|
*/
|
|
|
|
var $useTable = 'i18n';
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-11-03 23:58:44 +00:00
|
|
|
/**
|
|
|
|
* displayField property
|
|
|
|
*
|
|
|
|
* @var string 'field'
|
|
|
|
* @access public
|
|
|
|
*/
|
|
|
|
var $displayField = 'field';
|
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2010-01-24 22:57:08 +00:00
|
|
|
/**
|
|
|
|
* TranslateTestModel class.
|
|
|
|
*
|
|
|
|
* @package cake
|
|
|
|
* @subpackage cake.tests.cases.libs.model
|
|
|
|
*/
|
|
|
|
class TranslateWithPrefix extends CakeTestModel {
|
|
|
|
/**
|
|
|
|
* name property
|
|
|
|
*
|
|
|
|
* @var string 'TranslateTestModel'
|
|
|
|
* @access public
|
|
|
|
*/
|
|
|
|
var $name = 'TranslateWithPrefix';
|
|
|
|
/**
|
|
|
|
* tablePrefix property
|
|
|
|
*
|
|
|
|
* @var string 'i18n'
|
|
|
|
* @access public
|
|
|
|
*/
|
|
|
|
var $tablePrefix = 'i18n_';
|
|
|
|
/**
|
|
|
|
* displayField property
|
|
|
|
*
|
|
|
|
* @var string 'field'
|
|
|
|
* @access public
|
|
|
|
*/
|
|
|
|
var $displayField = 'field';
|
|
|
|
}
|
2008-11-03 23:58:44 +00:00
|
|
|
/**
|
|
|
|
* TranslatedItem class.
|
|
|
|
*
|
2009-03-18 17:55:58 +00:00
|
|
|
* @package cake
|
2008-11-03 23:58:44 +00:00
|
|
|
* @subpackage cake.tests.cases.libs.model
|
|
|
|
*/
|
|
|
|
class TranslatedItem extends CakeTestModel {
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-11-03 23:58:44 +00:00
|
|
|
/**
|
|
|
|
* name property
|
|
|
|
*
|
|
|
|
* @var string 'TranslatedItem'
|
|
|
|
* @access public
|
|
|
|
*/
|
|
|
|
var $name = 'TranslatedItem';
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-11-03 23:58:44 +00:00
|
|
|
/**
|
|
|
|
* cacheQueries property
|
|
|
|
*
|
|
|
|
* @var bool false
|
|
|
|
* @access public
|
|
|
|
*/
|
|
|
|
var $cacheQueries = false;
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-11-03 23:58:44 +00:00
|
|
|
/**
|
|
|
|
* actsAs property
|
|
|
|
*
|
|
|
|
* @var array
|
|
|
|
* @access public
|
|
|
|
*/
|
|
|
|
var $actsAs = array('Translate' => array('content', 'title'));
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-11-03 23:58:44 +00:00
|
|
|
/**
|
|
|
|
* translateModel property
|
|
|
|
*
|
|
|
|
* @var string 'TranslateTestModel'
|
|
|
|
* @access public
|
|
|
|
*/
|
|
|
|
var $translateModel = 'TranslateTestModel';
|
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2010-01-24 22:57:08 +00:00
|
|
|
/**
|
|
|
|
* TranslatedItem class.
|
|
|
|
*
|
|
|
|
* @package cake
|
|
|
|
* @subpackage cake.tests.cases.libs.model
|
|
|
|
*/
|
|
|
|
class TranslatedItem2 extends CakeTestModel {
|
|
|
|
/**
|
|
|
|
* name property
|
|
|
|
*
|
|
|
|
* @var string 'TranslatedItem'
|
|
|
|
* @access public
|
|
|
|
*/
|
|
|
|
var $name = 'TranslatedItem';
|
|
|
|
/**
|
|
|
|
* cacheQueries property
|
|
|
|
*
|
|
|
|
* @var bool false
|
|
|
|
* @access public
|
|
|
|
*/
|
|
|
|
var $cacheQueries = false;
|
|
|
|
/**
|
|
|
|
* actsAs property
|
|
|
|
*
|
|
|
|
* @var array
|
|
|
|
* @access public
|
|
|
|
*/
|
|
|
|
var $actsAs = array('Translate' => array('content', 'title'));
|
|
|
|
/**
|
|
|
|
* translateModel property
|
|
|
|
*
|
|
|
|
* @var string 'TranslateTestModel'
|
|
|
|
* @access public
|
|
|
|
*/
|
|
|
|
var $translateModel = 'TranslateWithPrefix';
|
|
|
|
}
|
2008-11-03 23:58:44 +00:00
|
|
|
/**
|
|
|
|
* TranslatedItemWithTable class.
|
|
|
|
*
|
2009-03-18 17:55:58 +00:00
|
|
|
* @package cake
|
2008-11-03 23:58:44 +00:00
|
|
|
* @subpackage cake.tests.cases.libs.model
|
|
|
|
*/
|
|
|
|
class TranslatedItemWithTable extends CakeTestModel {
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-11-03 23:58:44 +00:00
|
|
|
/**
|
|
|
|
* name property
|
|
|
|
*
|
|
|
|
* @var string 'TranslatedItemWithTable'
|
|
|
|
* @access public
|
|
|
|
*/
|
|
|
|
var $name = 'TranslatedItemWithTable';
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-11-03 23:58:44 +00:00
|
|
|
/**
|
|
|
|
* useTable property
|
|
|
|
*
|
|
|
|
* @var string 'translated_items'
|
|
|
|
* @access public
|
|
|
|
*/
|
|
|
|
var $useTable = 'translated_items';
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-11-03 23:58:44 +00:00
|
|
|
/**
|
|
|
|
* cacheQueries property
|
|
|
|
*
|
|
|
|
* @var bool false
|
|
|
|
* @access public
|
|
|
|
*/
|
|
|
|
var $cacheQueries = false;
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-11-03 23:58:44 +00:00
|
|
|
/**
|
|
|
|
* actsAs property
|
|
|
|
*
|
|
|
|
* @var array
|
|
|
|
* @access public
|
|
|
|
*/
|
|
|
|
var $actsAs = array('Translate' => array('content', 'title'));
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-11-03 23:58:44 +00:00
|
|
|
/**
|
|
|
|
* translateModel property
|
|
|
|
*
|
|
|
|
* @var string 'TranslateTestModel'
|
|
|
|
* @access public
|
|
|
|
*/
|
|
|
|
var $translateModel = 'TranslateTestModel';
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-11-03 23:58:44 +00:00
|
|
|
/**
|
|
|
|
* translateTable property
|
|
|
|
*
|
|
|
|
* @var string 'another_i18n'
|
|
|
|
* @access public
|
|
|
|
*/
|
|
|
|
var $translateTable = 'another_i18n';
|
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-11-03 23:58:44 +00:00
|
|
|
/**
|
|
|
|
* TranslateArticleModel class.
|
|
|
|
*
|
2009-03-18 17:55:58 +00:00
|
|
|
* @package cake
|
2008-11-03 23:58:44 +00:00
|
|
|
* @subpackage cake.tests.cases.libs.model
|
|
|
|
*/
|
|
|
|
class TranslateArticleModel extends CakeTestModel {
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-11-03 23:58:44 +00:00
|
|
|
/**
|
|
|
|
* name property
|
|
|
|
*
|
|
|
|
* @var string 'TranslateArticleModel'
|
|
|
|
* @access public
|
|
|
|
*/
|
|
|
|
var $name = 'TranslateArticleModel';
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-11-03 23:58:44 +00:00
|
|
|
/**
|
|
|
|
* useTable property
|
|
|
|
*
|
|
|
|
* @var string 'article_i18n'
|
|
|
|
* @access public
|
|
|
|
*/
|
|
|
|
var $useTable = 'article_i18n';
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-11-03 23:58:44 +00:00
|
|
|
/**
|
|
|
|
* displayField property
|
|
|
|
*
|
|
|
|
* @var string 'field'
|
|
|
|
* @access public
|
|
|
|
*/
|
|
|
|
var $displayField = 'field';
|
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-11-03 23:58:44 +00:00
|
|
|
/**
|
|
|
|
* TranslatedArticle class.
|
|
|
|
*
|
2009-03-18 17:55:58 +00:00
|
|
|
* @package cake
|
2008-11-03 23:58:44 +00:00
|
|
|
* @subpackage cake.tests.cases.libs.model
|
|
|
|
*/
|
|
|
|
class TranslatedArticle extends CakeTestModel {
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-11-03 23:58:44 +00:00
|
|
|
/**
|
|
|
|
* name property
|
|
|
|
*
|
|
|
|
* @var string 'TranslatedArticle'
|
|
|
|
* @access public
|
|
|
|
*/
|
|
|
|
var $name = 'TranslatedArticle';
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-11-03 23:58:44 +00:00
|
|
|
/**
|
|
|
|
* cacheQueries property
|
|
|
|
*
|
|
|
|
* @var bool false
|
|
|
|
* @access public
|
|
|
|
*/
|
|
|
|
var $cacheQueries = false;
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-11-03 23:58:44 +00:00
|
|
|
/**
|
|
|
|
* actsAs property
|
|
|
|
*
|
|
|
|
* @var array
|
|
|
|
* @access public
|
|
|
|
*/
|
|
|
|
var $actsAs = array('Translate' => array('title', 'body'));
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-11-03 23:58:44 +00:00
|
|
|
/**
|
|
|
|
* translateModel property
|
|
|
|
*
|
|
|
|
* @var string 'TranslateArticleModel'
|
|
|
|
* @access public
|
|
|
|
*/
|
|
|
|
var $translateModel = 'TranslateArticleModel';
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-11-03 23:58:44 +00:00
|
|
|
/**
|
|
|
|
* belongsTo property
|
|
|
|
*
|
|
|
|
* @var array
|
|
|
|
* @access public
|
|
|
|
*/
|
|
|
|
var $belongsTo = array('User');
|
|
|
|
}
|
2008-12-12 17:19:27 +00:00
|
|
|
|
2008-12-17 04:13:45 +00:00
|
|
|
class CounterCacheUser extends CakeTestModel {
|
|
|
|
var $name = 'CounterCacheUser';
|
|
|
|
var $alias = 'User';
|
|
|
|
|
|
|
|
var $hasMany = array('Post' => array(
|
|
|
|
'className' => 'CounterCachePost',
|
|
|
|
'foreignKey' => 'user_id'
|
|
|
|
));
|
|
|
|
}
|
|
|
|
|
|
|
|
class CounterCachePost extends CakeTestModel {
|
|
|
|
var $name = 'CounterCachePost';
|
|
|
|
var $alias = 'Post';
|
|
|
|
|
|
|
|
var $belongsTo = array('User' => array(
|
|
|
|
'className' => 'CounterCacheUser',
|
|
|
|
'foreignKey' => 'user_id',
|
|
|
|
'counterCache' => true
|
|
|
|
));
|
|
|
|
}
|
|
|
|
|
2009-04-13 14:15:58 +00:00
|
|
|
class CounterCacheUserNonstandardPrimaryKey extends CakeTestModel {
|
|
|
|
var $name = 'CounterCacheUserNonstandardPrimaryKey';
|
|
|
|
var $alias = 'User';
|
|
|
|
var $primaryKey = 'uid';
|
|
|
|
|
|
|
|
var $hasMany = array('Post' => array(
|
|
|
|
'className' => 'CounterCachePostNonstandardPrimaryKey',
|
|
|
|
'foreignKey' => 'uid'
|
|
|
|
));
|
|
|
|
}
|
|
|
|
|
|
|
|
class CounterCachePostNonstandardPrimaryKey extends CakeTestModel {
|
|
|
|
var $name = 'CounterCachePostNonstandardPrimaryKey';
|
|
|
|
var $alias = 'Post';
|
|
|
|
var $primaryKey = 'pid';
|
|
|
|
|
|
|
|
var $belongsTo = array('User' => array(
|
|
|
|
'className' => 'CounterCacheUserNonstandardPrimaryKey',
|
|
|
|
'foreignKey' => 'uid',
|
|
|
|
'counterCache' => true
|
|
|
|
));
|
|
|
|
}
|
|
|
|
|
2008-12-12 17:19:27 +00:00
|
|
|
class ArticleB extends CakeTestModel {
|
|
|
|
var $name = 'ArticleB';
|
|
|
|
var $useTable = 'articles';
|
|
|
|
var $hasAndBelongsToMany = array(
|
|
|
|
'TagB' => array(
|
|
|
|
'className' => 'TagB',
|
|
|
|
'joinTable' => 'articles_tags',
|
|
|
|
'foreignKey' => 'article_id',
|
2008-12-17 04:13:45 +00:00
|
|
|
'associationForeignKey' => 'tag_id'
|
|
|
|
)
|
|
|
|
);
|
2008-12-12 17:19:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
class TagB extends CakeTestModel {
|
|
|
|
var $name = 'TagB';
|
|
|
|
var $useTable = 'tags';
|
|
|
|
var $hasAndBelongsToMany = array(
|
|
|
|
'ArticleB' => array(
|
|
|
|
'className' => 'ArticleB',
|
|
|
|
'joinTable' => 'articles_tags',
|
|
|
|
'foreignKey' => 'tag_id',
|
2008-12-17 04:13:45 +00:00
|
|
|
'associationForeignKey' => 'article_id'
|
|
|
|
)
|
|
|
|
);
|
2008-12-12 17:19:27 +00:00
|
|
|
}
|
2008-12-17 04:13:45 +00:00
|
|
|
|
2008-12-25 22:51:10 +00:00
|
|
|
class Fruit extends CakeTestModel {
|
|
|
|
var $name = 'Fruit';
|
2008-12-29 03:20:05 +00:00
|
|
|
var $hasAndBelongsToMany = array(
|
|
|
|
'UuidTag' => array(
|
|
|
|
'className' => 'UuidTag',
|
|
|
|
'joinTable' => 'fruits_uuid_tags',
|
|
|
|
'foreignKey' => 'fruit_id',
|
|
|
|
'associationForeignKey' => 'uuid_tag_id',
|
|
|
|
'with' => 'FruitsUuidTag'
|
|
|
|
)
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
class FruitsUuidTag extends CakeTestModel {
|
|
|
|
var $name = 'FruitsUuidTag';
|
|
|
|
var $primaryKey = false;
|
|
|
|
var $belongsTo = array(
|
|
|
|
'UuidTag' => array(
|
|
|
|
'className' => 'UuidTag',
|
|
|
|
'foreignKey' => 'uuid_tag_id',
|
2009-01-14 23:40:47 +00:00
|
|
|
),
|
2008-12-29 03:20:05 +00:00
|
|
|
'Fruit' => array(
|
|
|
|
'className' => 'Fruit',
|
|
|
|
'foreignKey' => 'fruit_id',
|
|
|
|
)
|
|
|
|
);
|
2008-12-25 22:51:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
class UuidTag extends CakeTestModel {
|
|
|
|
var $name = 'UuidTag';
|
2008-12-29 03:20:05 +00:00
|
|
|
var $hasAndBelongsToMany = array(
|
|
|
|
'Fruit' => array(
|
|
|
|
'className' => 'Fruit',
|
|
|
|
'joinTable' => 'fruits_uuid_tags',
|
|
|
|
'foreign_key' => 'uuid_tag_id',
|
|
|
|
'associationForeignKey' => 'fruit_id',
|
|
|
|
'with' => 'FruitsUuidTag'
|
|
|
|
)
|
|
|
|
);
|
2008-12-25 22:51:10 +00:00
|
|
|
}
|
2008-12-30 16:09:25 +00:00
|
|
|
|
|
|
|
class FruitNoWith extends CakeTestModel {
|
|
|
|
var $name = 'Fruit';
|
|
|
|
var $useTable = 'fruits';
|
|
|
|
var $hasAndBelongsToMany = array(
|
|
|
|
'UuidTag' => array(
|
|
|
|
'className' => 'UuidTagNoWith',
|
|
|
|
'joinTable' => 'fruits_uuid_tags',
|
|
|
|
'foreignKey' => 'fruit_id',
|
|
|
|
'associationForeignKey' => 'uuid_tag_id',
|
|
|
|
)
|
|
|
|
);
|
|
|
|
}
|
2010-11-03 13:25:42 +00:00
|
|
|
|
2008-12-30 16:09:25 +00:00
|
|
|
class UuidTagNoWith extends CakeTestModel {
|
|
|
|
var $name = 'UuidTag';
|
|
|
|
var $useTable = 'uuid_tags';
|
|
|
|
var $hasAndBelongsToMany = array(
|
|
|
|
'Fruit' => array(
|
|
|
|
'className' => 'FruitNoWith',
|
|
|
|
'joinTable' => 'fruits_uuid_tags',
|
|
|
|
'foreign_key' => 'uuid_tag_id',
|
|
|
|
'associationForeignKey' => 'fruit_id',
|
|
|
|
)
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2009-09-09 03:48:32 +00:00
|
|
|
class ProductUpdateAll extends CakeTestModel {
|
|
|
|
var $name = 'ProductUpdateAll';
|
|
|
|
var $useTable = 'product_update_all';
|
|
|
|
}
|
|
|
|
|
|
|
|
class GroupUpdateAll extends CakeTestModel {
|
|
|
|
var $name = 'GroupUpdateAll';
|
|
|
|
var $useTable = 'group_update_all';
|
|
|
|
}
|
2010-11-03 13:25:42 +00:00
|
|
|
|
|
|
|
class TransactionTestModel extends CakeTestModel {
|
|
|
|
var $name = 'TransactionTestModel';
|
|
|
|
var $useTable = 'samples';
|
|
|
|
|
|
|
|
function afterSave($created) {
|
|
|
|
$data = array(
|
|
|
|
array('apple_id' => 1, 'name' => 'sample6'),
|
|
|
|
);
|
|
|
|
$this->saveAll($data, array('atomic' => true, 'callbacks' => false));
|
|
|
|
}
|
|
|
|
}
|