本文整理汇总了PHP中Partner::setR_user方法的典型用法代码示例。如果您正苦于以下问题:PHP Partner::setR_user方法的具体用法?PHP Partner::setR_user怎么用?PHP Partner::setR_user使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Partner
的用法示例。
在下文中一共展示了Partner::setR_user方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: actionSavePartner
function actionSavePartner($currentUser)
{
$backUrl = $this->context->getFlowScopeAttr("backUrl");
$partnerID = $this->context->getRequestAttr("id");
$partner = new Partner();
$partnerErrs = array();
$partner->setId($this->context->getRequestAttr("id"));
$partner->setPid($this->context->getRequestAttr("projectID"));
$partner->setName($this->context->getRequestAttr("name"));
if (!is_null($partner->getName())) {
$partner->setName(trim($partner->getName()));
if (strlen($partner->getName()) < 1) {
$partner->setName(null);
}
}
if (is_null($partner->getName())) {
$partnerErrs["name"] = "field.error.empty";
}
$partner->setEmail($this->context->getRequestAttr("email"));
if (!is_null($partner->getEmail())) {
$partner->setEmail(trim($partner->getEmail()));
if (strlen($partner->getEmail()) < 1) {
$partner->setEmail(null);
}
}
if (is_null($partner->getEmail())) {
$partnerErrs["email"] = "field.error.empty";
}
$partner->setTelephone($this->context->getRequestAttr("telephone"));
if (!is_null($partner->getTelephone())) {
$partner->setTelephone(trim($partner->getTelephone()));
if (strlen($partner->getTelephone()) < 1) {
$partner->setTelephone(null);
}
}
if (is_null($partner->getTelephone())) {
$partnerErrs["telephone"] = "field.error.empty";
}
$create = $this->context->getRequestAttr("create");
$partner->setCan_create($create == "1" ? true : false);
$timeZone = new DateTimeZone("Europe/Vilnius");
$time = new DateTime("now", $timeZone);
$partner->setR_date($time->format("Y-m-d H:i:s"));
$partner->setR_user($currentUser->getId());
$this->context->setFlashScopeAttr("partner", $partner);
$this->context->setFlashScopeAttr("partnerErrs", $partnerErrs);
if (!is_null($partner->getId())) {
$oldPartner = $this->partnerDao->get($partner->getId());
if (is_null($oldPartner) || is_string($oldPartner)) {
$this->context->setRequestScopeAttr("error", "partner.error.notfound");
$this->cancelPartnerEdit();
if (!is_null($backUrl)) {
header("Location: " . $backUrl);
return true;
}
return false;
}
}
$projectID = $partner->getPid();
if (is_null($projectID)) {
$this->context->setRequestScopeAttr("error", "project.error.notfound");
$this->cancelPartnerEdit();
if (!is_null($backUrl)) {
header("Location: " . $backUrl);
return true;
}
return false;
}
$project = $this->projectDao->get($projectID);
if (is_null($project)) {
$this->context->setRequestScopeAttr("error", "project.error.notfound");
$this->cancelPartnerEdit();
if (!is_null($backUrl)) {
header("Location: " . $backUrl);
return true;
}
return false;
} else {
if (is_string($project)) {
$this->context->setRequestScopeAttr("error", "error.dberror");
$this->context->setRequestScopeAttr("errortxt", $project);
$project = null;
$this->cancelPartnerEdit();
if (!is_null($backUrl)) {
header("Location: " . $backUrl);
return true;
}
return false;
}
}
$this->context->setFlashScopeAttr("partnerProject", $project);
if (count($partnerErrs) >= 1) {
if (!is_null($backUrl)) {
header("Location: " . $backUrl);
return true;
}
return false;
}
if (!is_null($partner->getId())) {
if ($oldPartner->getEmail() != $partner->getEmail()) {
//.........这里部分代码省略.........
示例2: find
function find($criteria = null, $order = null, $limit = 1000, $from = 0)
{
$result = $this->database->query($this->buildFindQuery($criteria, $order, $limit, $from));
if (!is_null($result->getError())) {
return $result->getError();
}
$partners = array();
while ($row = $result->fetchRow()) {
$partner = new Partner();
$value = $row[0];
$partner->setId($value);
$value = $row[1];
$partner->setPid($value);
$value = $row[2];
$partner->setName($value);
$value = $row[3];
$partner->setEmail($value);
$value = $row[4];
$partner->setTelephone($value);
$value = $row[5];
$partner->setCommission($value);
$value = $row[6];
$value = $this->database->toBoolean($value);
$partner->setCan_create($value);
$value = $row[7];
$partner->setR_date($value);
$value = $row[8];
$partner->setR_user($value);
if ($order != null) {
array_push($partners, $partner);
} else {
$partners[$partner->getId()] = $partner;
}
}
return $partners;
}