Esempio n. 1
0
 /**
  * Does this PageArray contain the given index or Page? 
  *
  * @param Page|int $key Page Array index or Page object. 
  * @return bool True if the index or Page exists here, false if not. 
  */
 public function has($key)
 {
     if (is_int($key) || is_string($key)) {
         return parent::has($key);
     }
     $has = false;
     if (is_object($key) && $key instanceof Page) {
         foreach ($this as $k => $pg) {
             $has = $pg->id == $key->id;
             if ($has) {
                 break;
             }
         }
     }
     return $has;
 }