X-Git-Url: https://dev.renevier.net/?a=blobdiff_plain;f=application%2Fmodels%2FPath.php;h=28e5c9021b2d614d4fc2dcd9ed187a7bd09590ee;hb=f9496a89b1cdbb8bed26742f19fc36559e502264;hp=41706e4f58d3bc736c6efc663bc5071a9d8743af;hpb=190fd621df4920c56a422c03663874cddaa67d64;p=syj.git diff --git a/application/models/Path.php b/application/models/Path.php index 41706e4..28e5c90 100644 --- a/application/models/Path.php +++ b/application/models/Path.php @@ -1,14 +1,15 @@ _id = (int) $id; @@ -28,13 +29,20 @@ class Syj_Model_Path extends Syj_Model_Generic return $this->_geom; } - public function setOwner(Syj_Model_User $owner) { - $this->_owner = $owner; + public function setCreator(Syj_Model_User $creator = null) { + $this->_creator = $creator; return $this; } - public function getOwner() { - return $this->_owner; + public function getCreator() { + return $this->_creator; + } + + public function isCreator(Syj_Model_User $creator = null) { + if (!$creator or !$this->creator) { + return false; + } + return ($creator->id == $this->creator->id); } public function setTitle($title) { @@ -50,7 +58,8 @@ class Syj_Model_Path extends Syj_Model_Generic if ($this->_title) { return $this->_title; } else if ($this->_id) { - return "journey number " . (string)$this->_id; + $title = $this->getTranslator()->translate("route number %d"); + return str_replace('%d', (string)$this->id, $title); } else { return ""; } @@ -65,4 +74,13 @@ class Syj_Model_Path extends Syj_Model_Generic return $this->_urlcomp; } + public function setCreatorIp($_creator_ip) { + $this->_creator_ip = (string) $_creator_ip; + return $this; + } + + public function getCreatorIp() { + return $this->_creator_ip; + } + }