예제 #1
0
파일: Location.php 프로젝트: taryono/school
 public function getParentalIndex()
 {
     $parentalIndex = "#" . str_pad($this->getId(), 3, '0', STR_PAD_LEFT);
     $this->level = 1;
     if ($this->getParent() !== null && $this->getParent() != 0) {
         $p = LocationPeer::retrieveByPK($this->getParent());
         $parentalIndex = str_pad($p->getParentalIndex(), 3, '0', STR_PAD_LEFT) . "_" . $parentalIndex;
         $this->level += $p->level;
     }
     $this->parentalIndex = $parentalIndex;
     return $parentalIndex;
 }
예제 #2
0
 public function getLocation($con = null)
 {
     include_once 'lib/model/om/BaseLocationPeer.php';
     if ($this->aLocation === null && $this->location_id !== null) {
         $this->aLocation = LocationPeer::retrieveByPK($this->location_id, $con);
     }
     return $this->aLocation;
 }
예제 #3
0
 public function getLocationRelatedByLocation2($con = null)
 {
     include_once 'lib/model/om/BaseLocationPeer.php';
     if ($this->aLocationRelatedByLocation2 === null && $this->location2 !== null) {
         $this->aLocationRelatedByLocation2 = LocationPeer::retrieveByPK($this->location2, $con);
     }
     return $this->aLocationRelatedByLocation2;
 }
예제 #4
0
 public function getLocationRelatedByParent($con = null)
 {
     include_once 'lib/model/om/BaseLocationPeer.php';
     if ($this->aLocationRelatedByParent === null && $this->parent !== null) {
         $this->aLocationRelatedByParent = LocationPeer::retrieveByPK($this->parent, $con);
     }
     return $this->aLocationRelatedByParent;
 }