/** * * @param Model_Page_Front $page * @param string $key * @param boolean $inherit * @return boolean */ public static function exists(Model_Page_Front $page, $key, $inherit = FALSE) { if (Arr::get(self::$_fields, $page->id()) === NULL) { self::$_fields[$page->id()] = ORM::factory('Page_Field')->get_by_page_id($page->id())->as_array('key', 'value'); } if (isset(self::$_fields[$page->id()][$key])) { return TRUE; } else { if ($inherit !== FALSE and $page->parent() instanceof Model_Page_Front) { return self::exists($page->parent(), $key, $inherit); } } return FALSE; }
/** * * @param Model_Page_Front $page * @param string $part * @param boolean $inherit * @return boolean */ public static function exists(Model_Page_Front $page, $part, $inherit = FALSE) { self::_load_parts($page->id()); if (isset(self::$_cache[$page->id()][$part])) { return TRUE; } else { if ($inherit !== FALSE and $page->parent() instanceof Model_Page_Front) { return self::exists($this->parent(), $part, TRUE); } } return FALSE; }