X-Git-Url: https://dev.renevier.net/?p=syj.git;a=blobdiff_plain;f=application%2Fmodels%2FPathMapper.php;h=2bbeabb7a334d1dbff3e75be7f15d34cc81408d6;hp=7f43e2239b64bae6d1187c9ea1c44f6571d77059;hb=00c2579ade64a20ba2d82e98d3eea5f864864cdb;hpb=d2d165910aacef01961120326452e616f53991f2 diff --git a/application/models/PathMapper.php b/application/models/PathMapper.php index 7f43e22..2bbeabb 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); @@ -74,6 +80,7 @@ class Syj_Model_PathMapper $path->id = $this->getDbTable()->insert($data); } else { $this->getDbTable()->update($data, array('id = ?' => $id)); + $path->invalidateCache(); } }