X-Git-Url: https://dev.renevier.net/?p=syj.git;a=blobdiff_plain;f=application%2Fmodels%2FPath.php;h=1041a7f597ef90c22aba793847eeb1f692db07c5;hp=41706e4f58d3bc736c6efc663bc5071a9d8743af;hb=a64d41557a62ec6051d7fa08d1ba941e089aa5c2;hpb=3c4eae3c94fd2369087cd3cc73e195cbc48fc433 diff --git a/application/models/Path.php b/application/models/Path.php index 41706e4..1041a7f 100644 --- a/application/models/Path.php +++ b/application/models/Path.php @@ -6,9 +6,10 @@ class Syj_Model_Path extends Syj_Model_Generic { protected $_id; protected $_geom; - protected $_owner; + protected $_creator; protected $_title; protected $_urlcomp; + protected $_creator_ip; public function setId($id) { $this->_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) { @@ -65,4 +73,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; + } + }