4 require_once
'Services/Contact/BuddySystem/interfaces/interface.ilBuddySystemCollection.php';
47 return $this->
get($offset);
61 $this->
set($offset, $value);
69 $this->
remove($offset);
77 return count($this->elements);
83 public function add($element)
85 $this->elements[] = $element;
91 public function remove($key)
93 if(!isset($this->elements[$key]) && !array_key_exists($key, $this->elements))
97 unset($this->elements[$key]);
105 $key = array_search($element, $this->elements,
true);
110 unset($this->elements[$key]);
118 return isset($this->elements[$key]) || array_key_exists($key, $this->elements);
127 return array_search($element, $this->elements,
true);
135 $this->elements =
array();
143 return in_array($element, $this->elements,
true);
149 public function get($key)
151 return isset($this->elements[$key]) ? $this->elements[$key] : null;
157 public function set($key, $value)
159 $this->elements[$key] = $value;
167 return empty($this->elements);
175 return array_keys($this->elements);
183 return array_values($this->elements);
191 return new static(array_filter($this->elements, $p));
197 public function slice($offset, $length = null)
199 return new static(array_slice($this->elements, $offset, $length,
true));
add($element)
Adds an element at the end of the collection.
getValues()
Gets all values of the collection.array The values of all elements in the collection, in the order they appear in the collection.
isEmpty()
boolean true if the collection is empty, false otherwise.
Interface ilBuddySystemCollection.
__construct(array $elements=array())
Class ilBuddySystemArrayCollection A collection which contains all entries of a buddy list...
offsetSet($offset, $value)
filter(Closure $p)
Returns all the elements of this collection that satisfy the predicate $callable.ilBuddySystemCollect...
slice($offset, $length=null)
Extracts a slice of $length elements starting at position $offset from the Collection.If $length is null it returns all elements from $offset to the end of the Collection. Calling this method will only return the selected slice and NOT change the elements contained in the collection slice is called on. The offset to start from. The maximum number of elements to return, or null for no limit. ilBuddySystemCollection
containsKey($key)
The index to check for. boolean true if the collection contains the element, false otherwise...
contains($element)
boolean true if the collection contains the element, false otherwise.
getKeys()
Gets all indices of the collection.array The indices of the collection, in the order of the correspon...
Create styles array
The data for the language used.
removeElement($element)
The element to remove.