mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-31 09:06:17 +00:00
Code formatting and 1.2 interface updates
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@3689 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
3e21696255
commit
eea428e55d
4 changed files with 41 additions and 3 deletions
|
@ -95,6 +95,13 @@ class Controller extends Object {
|
|||
* @access public
|
||||
*/
|
||||
var $data = array();
|
||||
/**
|
||||
* POST'ed model data
|
||||
*
|
||||
* @var array
|
||||
* @access public
|
||||
*/
|
||||
var $paginate = array('limit' => 20);
|
||||
/**
|
||||
* Sub-path for view files
|
||||
*
|
||||
|
|
|
@ -1132,9 +1132,10 @@ class DboSource extends DataSource {
|
|||
* @param Model $model
|
||||
* @param array $fields
|
||||
* @param array $values
|
||||
* @param mixed $conditions
|
||||
* @return array
|
||||
*/
|
||||
function update(&$model, $fields = array(), $values = array()) {
|
||||
function update(&$model, $fields = array(), $values = array(), $conditions = null) {
|
||||
$updates = array();
|
||||
$combined = array_combine($fields, $values);
|
||||
|
||||
|
@ -1159,9 +1160,10 @@ class DboSource extends DataSource {
|
|||
*
|
||||
* @param Model $model
|
||||
* @param mixed $id Primary key id number to remove.
|
||||
* @param mixed $conditions
|
||||
* @return boolean Success
|
||||
*/
|
||||
function delete(&$model, $id = null) {
|
||||
function delete(&$model, $id = null, $conditions = null) {
|
||||
$_id = $model->id;
|
||||
if ($id != null) {
|
||||
$model->id = $id;
|
||||
|
|
|
@ -24,6 +24,8 @@
|
|||
* @lastmodified $Date$
|
||||
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
|
||||
*/
|
||||
uses('set');
|
||||
|
||||
/**
|
||||
* XML Helper class for easy output of XML structures.
|
||||
*
|
||||
|
@ -269,6 +271,33 @@ class XmlHelper extends Helper {
|
|||
}
|
||||
return $out;
|
||||
}
|
||||
/**
|
||||
* Serializes a model resultset into XML
|
||||
*
|
||||
* @param mixed $data The content to be converted to XML
|
||||
* @param array $options The data formatting options
|
||||
* @return string A copy of $data in XML format
|
||||
*/
|
||||
function serialize($data, $options = array()) {
|
||||
if (!class_exists('XML') && !class_exists('xml')) {
|
||||
uses('xml');
|
||||
}
|
||||
|
||||
$options = am(
|
||||
array('attributes' => false, 'format' => 'xml'),
|
||||
$options
|
||||
);
|
||||
|
||||
switch ($options['format']) {
|
||||
case 'xml':
|
||||
break;
|
||||
case 'attributes':
|
||||
break;
|
||||
}
|
||||
|
||||
$data = new XML($data);
|
||||
return $data->compose(false);
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
|
@ -40,7 +40,7 @@ uses (DS . 'view' . DS . 'helper');
|
|||
* @package cake
|
||||
* @subpackage cake.cake.libs.view
|
||||
*/
|
||||
class View extends Object{
|
||||
class View extends Object {
|
||||
/**
|
||||
* Name of the controller.
|
||||
*
|
||||
|
|
Loading…
Add table
Reference in a new issue