public function getParentName() { if ($this->getParent() != null && $this->getParent() != 0) { return VGradeSpecPeer::retrieveByPk($this->getParent())->getCode(); } return '-'; }
public static function doSelectFiltered(Criteria $criteria, $con = null) { $criteria->add(VGradeSpecPeer::ID, 5, Criteria::NOT_IN); $tmp_depts = VGradeSpecPeer::doSelect($criteria); $depts = array(); foreach ($tmp_depts as $key => $val) { $pi = $val->getParentalIndex(); $prefix = ''; for ($i = 0; $i < $val->level - 1; $i++) { $prefix .= ParamsPeer::retrieveByCode('tree_node_mark')->getValue(); } $val->setCode($prefix . $val->getCode()); $val->setDescription($prefix . $val->getDescription()); $depts[$pi] = $val; } ksort($depts); $result = array(); foreach ($depts as $r) { $result[] = $r; } return $result; }
public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME) { $keys = VGradeSpecPeer::getFieldNames($keyType); if (array_key_exists($keys[0], $arr)) { $this->setId($arr[$keys[0]]); } if (array_key_exists($keys[1], $arr)) { $this->setCode($arr[$keys[1]]); } if (array_key_exists($keys[2], $arr)) { $this->setParent($arr[$keys[2]]); } if (array_key_exists($keys[3], $arr)) { $this->setDescription($arr[$keys[3]]); } }
public static function retrieveByPKs($pks, $con = null) { if ($con === null) { $con = Propel::getConnection(self::DATABASE_NAME); } $objs = null; if (empty($pks)) { $objs = array(); } else { $criteria = new Criteria(); $criteria->add(VGradeSpecPeer::ID, $pks, Criteria::IN); $objs = VGradeSpecPeer::doSelect($criteria, $con); } return $objs; }