当前位置: 首页>>代码示例>>PHP>>正文


PHP Partner::setId方法代码示例

本文整理汇总了PHP中Partner::setId方法的典型用法代码示例。如果您正苦于以下问题:PHP Partner::setId方法的具体用法?PHP Partner::setId怎么用?PHP Partner::setId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Partner的用法示例。


在下文中一共展示了Partner::setId方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: strlen

        $charset .= "~@#\$%^*()_+-={}|][";
    }
    // Note: using all special characters this reads: "~!@#$%^&*()_+`-={}|\\]?[\":;'><,./";
    if ($minlength > $maxlength) {
        $length = mt_rand($maxlength, $minlength);
    } else {
        $length = mt_rand($minlength, $maxlength);
    }
    $key = "";
    for ($i = 0; $i < $length; $i++) {
        $key .= $charset[mt_rand(0, strlen($charset) - 1)];
    }
    return md5($key);
}
$partner = new Partner();
$partner->setId(-3);
$partner->setPartnerName('Hosted Pages');
$partner->setPartnerAlias('Hosted Pages');
$partner->setDescription('Build-in partner - used for hosted pages');
$partner->setSecret(generateSecret());
$partner->setAdminSecret(generateSecret());
$partner->setMaxNumberOfHitsPerDay(-1);
$partner->setAppearInSearch(mySearchUtils::DISPLAY_IN_SEARCH_NONE);
$partner->setInvalidLoginCount(0);
$partner->setKsMaxExpiryInSeconds(86400);
$partner->setCreateUserOnDemand(false);
$partner->setCommercialUse(false);
$partner->setModerateContent(false);
$partner->setNotify(false);
$partner->setIsFirstLogin(true);
$partner->setAdminLoginUsersQuota(0);
开发者ID:EfncoPlugins,项目名称:Media-Management-based-on-Kaltura,代码行数:31,代码来源:createHostedPagesPartner.php

示例2: 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()) {
//.........这里部分代码省略.........
开发者ID:Faradejus,项目名称:WorkFlow,代码行数:101,代码来源:projectApp.class.php

示例3: 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;
 }
开发者ID:Faradejus,项目名称:WorkFlow,代码行数:36,代码来源:partnerDao.class.php


注:本文中的Partner::setId方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。