[Gemstracker-svn] SF.net SVN: gemstracker:[766]
trunk/library/classes/MUtil/Model/ ModelAbstract.php
From: <gem...@li...> - 2012-06-15 07:47:50
|
Revision: 766 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=766&view=rev Author: mennodekker Date: 2012-06-15 07:47:40 +0000 (Fri, 15 Jun 2012) Log Message: ----------- Removed obsolete init method Modified Paths: -------------- trunk/library/classes/MUtil/Model/ModelAbstract.php Modified: trunk/library/classes/MUtil/Model/ModelAbstract.php =================================================================== --- trunk/library/classes/MUtil/Model/ModelAbstract.php 2012-06-14 16:10:18 UTC (rev 765) +++ trunk/library/classes/MUtil/Model/ModelAbstract.php 2012-06-15 07:47:40 UTC (rev 766) @@ -797,14 +797,6 @@ return false; } - /** - * This is the place to put code to run after object initialization has finished and when all - * registry requests have been answered - */ - public function init() - { - } - public function is($name, $key, $value) { return $value == $this->_getKeyValue($name, $key); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
[Gemstracker-svn] SF.net SVN: gemstracker:[898]
trunk/library/classes/MUtil/Model/ ModelAbstract.php
From: <gem...@li...> - 2012-08-20 12:29:01
|
Revision: 898 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=898&view=rev Author: mennodekker Date: 2012-08-20 12:28:52 +0000 (Mon, 20 Aug 2012) Log Message: ----------- Allow better ordering on derived models Modified Paths: -------------- trunk/library/classes/MUtil/Model/ModelAbstract.php Modified: trunk/library/classes/MUtil/Model/ModelAbstract.php =================================================================== --- trunk/library/classes/MUtil/Model/ModelAbstract.php 2012-08-20 11:09:25 UTC (rev 897) +++ trunk/library/classes/MUtil/Model/ModelAbstract.php 2012-08-20 12:28:52 UTC (rev 898) @@ -73,7 +73,12 @@ private $_model_order; private $_model_used = false; - public $orderIncrement = 10; //The default increment for item ordering + /** + * The increment for item ordering, default is 10 + * + * @var int + */ + public $orderIncrement = 10; public function __construct($modelName) { @@ -679,6 +684,18 @@ return $value; } + /** + * Find out the order of the requested $name in the model + * + * @param string $name + * @return int|null The order value of the requeste item or null if not defined + */ + public function getOrder($name) { + if (isset($this->_model_order[$name])) { + return $this->_model_order[$name]; + } + } + public function getRequestSort(Zend_Controller_Request_Abstract $request, $ascParam = null, $descParam = null) { // DEPRECIATED This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
[Gemstracker-svn] SF.net SVN: gemstracker:[943]
trunk/library/classes/MUtil/Model/ ModelAbstract.php
From: <gem...@li...> - 2012-09-18 15:19:48
|
Revision: 943 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=943&view=rev Author: matijsdejong Date: 2012-09-18 15:19:39 +0000 (Tue, 18 Sep 2012) Log Message: ----------- Bugfix: $model->get did not rise the return array when all names are requested. Cused pulse bug #560 Modified Paths: -------------- trunk/library/classes/MUtil/Model/ModelAbstract.php Modified: trunk/library/classes/MUtil/Model/ModelAbstract.php =================================================================== --- trunk/library/classes/MUtil/Model/ModelAbstract.php 2012-09-13 14:09:24 UTC (rev 942) +++ trunk/library/classes/MUtil/Model/ModelAbstract.php 2012-09-18 15:19:39 UTC (rev 943) @@ -464,10 +464,11 @@ case 0: if (isset($this->_model[$name])) { if ($alias = $this->getAlias($name)) { - return $this->_model[$name] + $this->get($alias); + $result = $this->_model[$name] + $this->get($alias); } else { - return $this->_model[$name]; + $result = $this->_model[$name]; } + return MUtil_Lazy::rise($result); } else { return array(); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
[Gemstracker-svn] SF.net SVN: gemstracker:[947]
trunk/library/classes/MUtil/Model/ ModelAbstract.php
From: <gem...@li...> - 2012-09-20 09:18:32
|
Revision: 947 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=947&view=rev Author: mennodekker Date: 2012-09-20 09:18:22 +0000 (Thu, 20 Sep 2012) Log Message: ----------- Micro-optimization: rise only once Modified Paths: -------------- trunk/library/classes/MUtil/Model/ModelAbstract.php Modified: trunk/library/classes/MUtil/Model/ModelAbstract.php =================================================================== --- trunk/library/classes/MUtil/Model/ModelAbstract.php 2012-09-19 13:08:21 UTC (rev 946) +++ trunk/library/classes/MUtil/Model/ModelAbstract.php 2012-09-20 09:18:22 UTC (rev 947) @@ -463,12 +463,11 @@ switch (count($args)) { case 0: if (isset($this->_model[$name])) { + $result = MUtil_Lazy::rise($this->_model[$name]); if ($alias = $this->getAlias($name)) { - $result = $this->_model[$name] + $this->get($alias); - } else { - $result = $this->_model[$name]; + $result = $result + $this->get($alias); } - return MUtil_Lazy::rise($result); + return $result; } else { return array(); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2013-01-21 16:39:01
|
Revision: 1119 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=1119&view=rev Author: matijsdejong Date: 2013-01-21 16:38:54 +0000 (Mon, 21 Jan 2013) Log Message: ----------- Disabled debug code Modified Paths: -------------- trunk/library/classes/MUtil/Model/ModelAbstract.php Modified: trunk/library/classes/MUtil/Model/ModelAbstract.php =================================================================== --- trunk/library/classes/MUtil/Model/ModelAbstract.php 2013-01-21 16:03:15 UTC (rev 1118) +++ trunk/library/classes/MUtil/Model/ModelAbstract.php 2013-01-21 16:38:54 UTC (rev 1119) @@ -1067,7 +1067,7 @@ public function loadFirst($filter = true, $sort = true) { $row = $this->_loadFirst($filter, $sort); - MUtil_Echo::track($row); + // MUtil_Echo::track($row); if (! is_array($row)) { // Return false @@ -1076,7 +1076,7 @@ // Transform the row $data = $this->processAfterLoad(array($row)); - MUtil_Echo::track($data); + // MUtil_Echo::track($data); // Return resulting first row return reset($data); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2013-03-12 20:13:13
|
Revision: 1174 http://sourceforge.net/p/gemstracker/code/1174 Author: matijsdejong Date: 2013-03-12 20:13:10 +0000 (Tue, 12 Mar 2013) Log Message: ----------- New getItemsOrdered caused breaks Modified Paths: -------------- trunk/library/classes/MUtil/Model/ModelAbstract.php Modified: trunk/library/classes/MUtil/Model/ModelAbstract.php =================================================================== --- trunk/library/classes/MUtil/Model/ModelAbstract.php 2013-03-12 19:59:39 UTC (rev 1173) +++ trunk/library/classes/MUtil/Model/ModelAbstract.php 2013-03-12 20:13:10 UTC (rev 1174) @@ -712,9 +712,19 @@ */ public function getItemsOrdered() { - asort($this->_model_order); - $order = array_keys($this->_model_order); - return $order + array_diff(array_keys($this->_model), $order); + $order = (array) $this->_model_order; + asort($order); + $result = array_keys($order); + foreach($this->_model as $field => $element) { + if (! array_key_exists($field, $order)) { + $result[] = $field; + } + } + return $result; + + // asort($this->_model_order); + // $order = array_keys($this->_model_order); + // return $order + array_diff(array_keys($this->_model), $order); } public function getItemsUsed() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |