Created
June 24, 2013 09:42
-
-
Save Archanium/5848949 to your computer and use it in GitHub Desktop.
New UrlModel
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Model\Common; | |
class Url extends \Base\Sql\Entity | |
{ | |
protected $active = 1; | |
protected $description; | |
protected $domain = ""; | |
protected $id; | |
protected $keywords; | |
protected $locale; | |
protected $shop_id; | |
protected $title; | |
protected $url_key; | |
public function deactivate() | |
{ | |
$this->active = 0; | |
} | |
public function getAllowIndex() | |
{ | |
return true; | |
} | |
// api compatibility methods | |
public function getDescription() | |
{ | |
return str_replace(" ", "", $this->description); | |
} | |
public function getKeywords() | |
{ | |
return str_replace(" ", "", $this->keywords); | |
} | |
public function getPageTitle() | |
{ | |
return str_replace(" ", "", $this->title); | |
} | |
public function getUrlKey() | |
{ | |
if (substr($this->url_key, -1) == "/" && strlen($this->url_key) > 1) { | |
$this->url_key = substr($this->url_key, 0, -1); | |
} | |
return $this->url_key; | |
} | |
public function hasDescription() | |
{ | |
return strlen($this->getDescription()) > 0; | |
} | |
public function hasGoogleVerification() | |
{ | |
return false; | |
} | |
public function hasKeywords() | |
{ | |
return strlen($this->getKeywords()) > 0; | |
} | |
public function hasMetaTitle() | |
{ | |
return false; | |
} | |
public function hasOgImage() | |
{ | |
return false; | |
} | |
public function hasPageTitle() | |
{ | |
return strlen($this->getPageTitle()) > 0; | |
} | |
public function isActive() | |
{ | |
return (bool) $this->active; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment