本文整理汇总了PHP中Dept::getId方法的典型用法代码示例。如果您正苦于以下问题:PHP Dept::getId方法的具体用法?PHP Dept::getId怎么用?PHP Dept::getId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Dept
的用法示例。
在下文中一共展示了Dept::getId方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: lookup
function lookup($id)
{
return $id && is_numeric($id) && ($dept = new Dept($id)) && $dept->getId() == $id ? $dept : null;
}
示例2: or
$errors['err']='Unable to fetch info on rep ID#'.$id;
}
}
$page=($staff or ($_REQUEST['a']=='new' && !$uID))?'staff.inc.php':'staffmembers.inc.php';
break;
default:
$page='staffmembers.inc.php';
}
break;
//Departments
case 'dept': //lazy
case 'depts':
$dept=null;
if(($id=$_REQUEST['id']?$_REQUEST['id']:$_POST['dept_id']) && is_numeric($id)) {
$dept= new Dept($id);
if(!$dept || !$dept->getId()) {
$dept=null;
$errors['err']='Unable to fetch info on Dept ID#'.$id;
}
}
$page=($dept or ($_REQUEST['a']=='new' && !$deptID))?'dept.inc.php':'depts.inc.php';
$nav->setTabActive('depts');
$nav->addSubMenu(array('desc'=>'Departments','href'=>'admin.php?t=depts','iconclass'=>'departments'));
$nav->addSubMenu(array('desc'=>'Add New Dept.','href'=>'admin.php?t=depts&a=new','iconclass'=>'newDepartment'));
break;
// (default)
default:
$page='pref.inc.php';
}
//========================= END ADMIN PAGE LOGIC ==============================//
示例3: filterByDept
/**
* Filter the query by a related Dept object
*
* @param Dept|PropelCollection $dept The related object(s) to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return CourseQuery The current query, for fluid interface
*/
public function filterByDept($dept, $comparison = null)
{
if ($dept instanceof Dept) {
return $this->addUsingAlias(CoursePeer::DEPT_ID, $dept->getId(), $comparison);
} elseif ($dept instanceof PropelCollection) {
if (null === $comparison) {
$comparison = Criteria::IN;
}
return $this->addUsingAlias(CoursePeer::DEPT_ID, $dept->toKeyValue('PrimaryKey', 'Id'), $comparison);
} else {
throw new PropelException('filterByDept() only accepts arguments of type Dept or PropelCollection');
}
}
示例4: setDept
/**
* Declares an association between this object and a Dept object.
*
* @param Dept $v
* @return Course The current object (for fluent API support)
* @throws PropelException
*/
public function setDept(Dept $v = null)
{
if ($v === null) {
$this->setDeptId(NULL);
} else {
$this->setDeptId($v->getId());
}
$this->aDept = $v;
// Add binding for other direction of this n:n relationship.
// If this object has already been added to the Dept object, it will not be re-added.
if ($v !== null) {
$v->addCourse($this);
}
return $this;
}
示例5: actionAddDept
/**
* Handler for add new dept
*/
public function actionAddDept()
{
$user = $_REQUEST['user'][0];
$sum = $_REQUEST['sum'][0];
$comment = $_REQUEST['comment'][0];
$date = $_REQUEST['date'][0];
$time = $_REQUEST['time'][0];
$attributs = array();
if ($user != '') {
$attributs['user_id'] = $user;
}
if ($sum != '') {
$attributs['sum'] = $sum;
}
if ($comment != '') {
$attributs['comment'] = $comment;
}
if ($date != '' && $time != '') {
$attributs['comment'] = $date . ' ' . $time;
}
if (isset($_REQUEST['id'])) {
$id = $_REQUEST['id'];
$attributs['id'] = $id;
}
$dept = new Dept($attributs);
$dept->save();
$id = $dept->getId();
$this->showResponse(array('status' => true, 'id' => $id));
}
示例6: prune
/**
* Exclude object from result
*
* @param Dept $dept Object to remove from the list of results
*
* @return DeptQuery The current query, for fluid interface
*/
public function prune($dept = null)
{
if ($dept) {
$this->addUsingAlias(DeptPeer::ID, $dept->getId(), Criteria::NOT_EQUAL);
}
return $this;
}