/** * Remove the given Page or key from the PageArray. * * @param int|Page $key * @return bool true if removed, false if not * */ public function remove($key) { // if a Page object has been passed, determine it's key if ($this->isValidItem($key)) { foreach ($this->data as $k => $pg) { if ($pg->id == $key->id) { $key = $k; break; } } } if ($this->has($key)) { parent::remove($key); $this->numTotal--; } return $this; }