Source for file PMO_MyArray.php
Documentation is available at PMO_MyArray.php
* This file contains PMO_MyConfig class which is used to store
* the PhpMyObject configuration.
* This file is part of the PhpMyObject project.
* For questions, help, comments, discussion, etc., please join our
* forum at {@link http://www.developpez.net/forums/forumdisplay.php?f=770}
* or our mailing list at {@link http://groups.google.com/group/pmo-dev}.
* PhpMyObject is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* @author Nicolas Boiteux <nicolas_boiteux@yahoo.fr>
* @link http://pmo.developpez.com/
* @since PhpMyObject v0.14
* @copyright Copyright (C) 2007-2008 Nicolas Boiteux
* @license GPLv3 {@link http://www.gnu.org/licenses/gpl}
* PMO_MyArray adds iterators to PMO stores.
public function append($value){
public function add($key, $value){
$this->array[$key] = $value;
$this->array[$key] = $value;
return $this->array[$key];
if(isset ($this->array[$key]))
public function arsort(int $sort_flags = NULL){
public function asort(int $sort_flags = NULL){
* already taken care by ArrayIterator as count();
public function count(int $mode = NULL){
public function get($key){
return $this->array[$key];
public function in_array(mixed $needle, array $haystack, bool $strict = NULL){
return in_array($needle, $this->array, $strict);
* return true if the key exists, false otherwise
* Note l'array est indexé numériquement. Donc la clé est un entier,
* à moins d'utiliser un map hash comme dans MyMapHash?
* @return bool true if the key exists, false otherwise
public function krsort(int $sort_flags = NULL){
public function ksort(int $sort_flags = NULL){
if($this->valid() == TRUE){
* merge any number of array to the main array
* arrays must be of the type provided when the object was istanciated
* @var array $arg,... any number of array to merge
public function merge($arg){
throw new Exception("Error: No argument provided");
public function pad(int $pad_size, mixed $pad_value){
* returns the last element from the array and removes it
* adds an object to the internal store
public function push($var){
if(isset ($this->instanceof))
if($var instanceof $this->instanceof)
throw new Exception("Error of type");
public function rand(int $num_req){
public function reverse(bool $preserve_keys = NULL){
* prepends a new object to the store
public function unshift(Object $var){
public function rsort(int $sort_flags = NULL){
public function search(mixed $needle, bool $strict = NULL){
* returns an object from the beginnig if the store and remvoes it
public function slice(int $offset,int $length = NULL, bool $preserve_keys = NULL){
public function sort(int $sort_flags = NULL){
|