/** * Sets an index in the PageArray. * * @param int $key Key of item to set. * @param Page $value Value of item. * @return $this * */ public function set($key, $value) { $has = $this->has($key); parent::set($key, $value); if (!$has) { $this->numTotal++; } return $this; }