ixed $data The description of the model, usually a string or array
* @return void
*/
function __cacheDescription($object, $data = null) {
if (Configure::read() > 0) {
$expires = "+15 seconds";
} else {
$expires = "+999 days";
}
if ($data !== null) {
$this->__descriptions[$object] =& $data;
$cache = serialize($data);
} else {
$cache = null;
}
$new = cache('models' . DS . ConnectionManager::getSourceName($this) . '_' . $object, $cache, $expires);
if ($new != null) {
$new = unserialize($new);
}
return $new;
}
/**
* To-be-overridden in subclasses.
*
* @return string
*/
function conditions($conditions) {
return $conditions;
}
/**
* To-be-overridden in subclasses.
*
* @param unknown_type $name
* @return unknown
*/
function name($name) {
return $name;
}
/**
* To-be-overridden in subclasses.
*
* @param unknown_type $value
* @return unknown
*/
function value($value) {
return $value;
}
/**
* Returns a Model description (metadata) or null if none found.
*
* @param Model $model
* @return mixed
*/
function describe($model) {
if (isset($this->__descriptions[$model->table])) {
return $this->__descriptions[$model->table];
}
$cache = $this->__cacheDescription($model->tablePrefix.$model->table);
if ($cache !== null) {
$this->__descriptions[$model->table] =& $cache;
return $cache;
}
return null;
}
/**
* To-be-overridden in subclasses.
*
* @param unknown_type $model
* @param unknown_type $fields
* @param unknown_type $values
* @return unknown
*/
function create(&$model, $fields = null, $values = null) {
return false;
}
/**
* To-be-overridden in subclasses.
*
* @param unknown_type $model
* @param unknown_type $queryData
* @return unknown
*/
function read(&$model, $queryData = array()) {
return false;
}
/**
* To-be-overridden in subclasses.
*
* @param unknown_type $model
* @param unknown_type $fields
* @param unknown_type $values
* @return unknown
*/
function update(&$model, $fields = null, $values = null) {
return false;
}
/**
* To-be-overridden in subclasses.
*
* @param unknown_type $model
* @param unknown_type $id
*/
function delete(&$model, $id = null) {
if ($id == null) {
$id = $model->id;
}
}
/**
* To-be-overridden in subclasses.
*
* @param mixed $fields
* @return mixed
*/
function fields($fields) {
return $fields;
}
/**
* To-be-overridden in subclasses.
*
* @param Model $model
* @param unknown_type $fields
* @return unknown
*/
function getColumnType(&$model, $fields) {
return false;
}
/**
* Enter description here...
*
* @param unknown_type $query
* @param unknown_type $data
* @param unknown_type $association
* @param unknown_type $assocData
* @param Model $model
* @param Model $linkModel
* @param array $stack
* @return unknown
*/
function insertQueryData($query, $data, $association, $assocData, &$model, &$linkModel, $stack) {
$keys = array('{$__cakeID__$}', '{$__cakeForeignKey__$}');
foreach($keys as $key) {
$val = null;
if (strpos($query, $key) !== false) {
switch($key) {
case '{$_