private function replaceDefaultTaxonomySlug($url, $taxonomyDetails) { $localeCode = $this->currentLocale->getCode(); if (Hash::check((array) $taxonomyDetails->i18n, "{$localeCode}.rewrite.slug")) { return Utility::replaceFirstOccurence(Hash::get($taxonomyDetails->i18n, "{$localeCode}.rewrite.slug"), $taxonomyDetails->rewrite['slug'], $url); } return $url; }
protected function removeLocalizedRoutedSlugs($route, $model) { if (!$this->currentLocale->isDefault() && is_array($model->routed)) { $key = "i18n." . $this->currentLocale->getCode() . ".rewrite"; if (Hash::check($model->routed, $key)) { foreach (Hash::get($model->routed, $key) as $rewriteKey => $rewriteUrl) { if (Hash::check($model->routed, "rewrite.{$rewriteKey}")) { $defaultValue = Hash::get($model->routed, "rewrite.{$rewriteKey}"); $route = Utility::replaceFirstOccurence($rewriteUrl, $defaultValue, $route); } } } } return $route; }
protected function extractLocalizedInformation() { foreach ($this->getLocales() as $locale) { $localeCode = $locale->getCode(); foreach ($this->model->routed['rewrite'] as $routeKey => $routeUrl) { $localizedUrl = $routeUrl; $localizedPath = "i18n.{$localeCode}.rewrite.{$routeKey}"; if (Hash::check($this->model->routed, $localizedPath)) { $localizedUrl = Hash::get($this->model->routed, $localizedPath); } $route = $this->createRouteFor($routeKey, $localizedUrl, array($localizedUrl, $routeUrl)); $this->addRoute($route); $this->queueRewrite($localizedUrl, $this->defaultSlug, $locale); } } }
protected function extractLocalizedInformation() { if ($this->modelSupportsRewrites()) { foreach ($this->getLocales() as $locale) { $localeCode = $locale->getCode(); $localizedSlug = $this->model->hasConfig("i18n.{$localeCode}.rewrite.slug") ? $this->model->getConfig("i18n.{$localeCode}.rewrite.slug") : $this->defaultSlug; foreach ($this->model->routed['rewrite'] as $routeKey => $routeUrl) { $localizedUrl = $routeUrl; $localizedPath = "i18n.{$localeCode}.rewrite.{$routeKey}"; if (Hash::check($this->model->routed, $localizedPath)) { $localizedUrl = Hash::get($this->model->routed, $localizedPath); } $this->addRoute($this->createRouteFor($localizedUrl, $localizedSlug)); $this->queueRewrite($localizedUrl, $localizedSlug, $locale); } } } }
/** * Returns whether the request contains uploaded files * @return boolean */ public function hasFiles() { return Hash::check($this->_FILES, "data.name") && count($this->_FILES["data"]["name"]); }
/** * Checks whether the specified attribute has declared any validations. * @param string $attr * @return boolean */ protected function hasAttributeValidation($attr) { return Hash::check($this->getAttributes(), "{$attr}.validations"); }
/** * Confirms the presence of a value in the custom post type's configuration array * @param string $key In dot-notation format * @return mixed */ public function hasConfig($key) { return Hash::check($this->getConfiguration(), $key); }