X-Git-Url: https://dev.renevier.net/?a=blobdiff_plain;f=application%2Fmodels%2FPathMapper.php;h=7d514e9f655a9ffac7c746f11cef451838468a52;hb=f9496a89b1cdbb8bed26742f19fc36559e502264;hp=51c2d34ebe19c27288812aecb66f0c38e43d1a10;hpb=1f6105289a49079809c2a4677b561bc82c62db88;p=syj.git diff --git a/application/models/PathMapper.php b/application/models/PathMapper.php index 51c2d34..7d514e9 100644 --- a/application/models/PathMapper.php +++ b/application/models/PathMapper.php @@ -35,6 +35,12 @@ class Syj_Model_PathMapper return $this->_fetchItem($select, $path); } + public function findByTitle($title, Syj_Model_Path $path) { + $select = $this->_select(); + $select->where('title = ?', (string)$title); + return $this->_fetchItem($select, $path); + } + public function findByUrl($url, Syj_Model_Path $path) { $select = $this->_select(); $select->where('id = ?', (int)$url)->orWhere('urlcomp = ?', (string)$url); @@ -66,7 +72,7 @@ class Syj_Model_PathMapper public function save (Syj_Model_Path $path) { $data = array( 'geom'=> (string)$path->geom, - 'creator'=> $path->creator->id, + 'creator'=> $path->creator? $path->creator->id: null, 'title'=> $path->title, 'creator_ip'=> $path->creatorIp );