本文整理匯總了PHP中Operator::setName方法的典型用法代碼示例。如果您正苦於以下問題:PHP Operator::setName方法的具體用法?PHP Operator::setName怎麽用?PHP Operator::setName使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Operator
的用法示例。
在下文中一共展示了Operator::setName方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: createAction
public function createAction()
{
$this->isAdmin();
if (isset($_POST['operator'])) {
$O_operator = new Operator();
$O_operator->setName($_POST['name']);
$O_operator->setFirstName($_POST['firstName']);
$O_operator->setSizeHarness($_POST['sizeHarness']);
$O_operator->setEmail($_POST['email']);
$O_operator->initInceptionDate();
$O_teamMapper = new TeamMapper();
$O_team = $O_teamMapper->findByTwoIds($_POST['staff_id'], $_POST['subgroup_id']);
$O_operator->setTeamId($O_team->getId());
$O_operatorMapper = new OperatorMapper();
$I_operatorId = $O_operatorMapper->insert($O_operator);
//die(header('Location:/user/default/'));
}
if (isset($_POST['inspector'])) {
$O_inspector = new Inspector();
$O_inspector->setName($_POST['name']);
$O_inspector->setFirstName($_POST['firstName']);
$O_inspector->setEmail($_POST['email']);
$O_inspector->setSubgroupId($_POST['subgroup_id']);
$O_inspector->initInceptionDate();
$O_inspectorMapper = new InspectorMapper();
$I_inspectorId = $O_inspectorMapper->insert($O_inspector);
}
$O_user = new User();
$O_user->setLogin($_POST['login']);
$O_user->setPassword($_POST['password']);
$O_user->setProfileId($_POST['profile_id']);
if (isset($_POST['operator'])) {
$O_user->setOperatorId($I_operatorId);
}
if (isset($_POST['inspector'])) {
$O_user->setInspectorId($I_inspectorId);
}
$O_userMapper = new UserMapper();
$I_userId = $O_userMapper->insert($O_user);
}