本文整理汇总了PHP中Partner::setName方法的典型用法代码示例。如果您正苦于以下问题:PHP Partner::setName方法的具体用法?PHP Partner::setName怎么用?PHP Partner::setName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Partner
的用法示例。
在下文中一共展示了Partner::setName方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setUp
/**
* Prepares the environment before running a test.
*/
protected function setUp()
{
parent::setUp();
$this->UserLoginData = new UserLoginData();
$this->dummyPartner = new Partner();
$this->dummyPartner->setName('TEST ONLY PARTNER!');
$this->dummyPartner->save();
$this->UserLoginData->setConfigPartnerId($this->dummyPartner->getId());
}
示例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()) {
//.........这里部分代码省略.........
示例3: getAllPartners
public static function getAllPartners()
{
if (Partner::$allPartners === null) {
Partner::$allPartners = array();
$partner = new Partner();
$partner->setID('finalfan');
$partner->setName("FinalFan sub");
$partner->setWebsiteUrl('http://finalfan51.free.fr/ffs/');
$partner->setBannerUrl('images/partenaires/finalfan.png');
$partner->setFansubPartner(true);
$partner->setDb0Company(false);
$partner->setOfficial(true);
Partner::$allPartners[] = $partner;
$partner = new Partner();
$partner->setID('mangas-arigatou');
$partner->setName("Mangas Arigatou");
$partner->setWebsiteUrl('http://www.mangas-arigatou.fr/');
$partner->setBannerUrl('images/partenaires/mangas_arigatou.png');
$partner->setFansubPartner(true);
$partner->setDb0Company(false);
$partner->setOfficial(true);
$partner->setOver(true);
Partner::$allPartners[] = $partner;
$partner = new Partner();
$partner->setID('kanaii');
$partner->setName("Kanaii");
$partner->setWebsiteUrl('http://www.kanaii.com');
$partner->setBannerUrl('images/partenaires/kanaii.png');
$partner->setFansubPartner(true);
$partner->setDb0Company(false);
$partner->setOfficial(true);
$partner->setOver(true);
Partner::$allPartners[] = $partner;
$partner = new Partner();
$partner->setID('kouhai');
$partner->setName("Kouhai Scantrad");
$partner->setWebsiteUrl('http://kouhaiscantrad.wordpress.com');
$partner->setBannerUrl('images/partenaires/kouhai.jpg');
$partner->setFansubPartner(true);
$partner->setDb0Company(false);
$partner->setOfficial(true);
$partner->setOver(true);
Partner::$allPartners[] = $partner;
$partner = new Partner();
$partner->setID('samazama');
$partner->setName("Samazama na Koto");
$partner->setWebsiteUrl('http://www.samazama.fr');
$partner->setBannerUrl('images/partenaires/samazama.gif');
$partner->setFansubPartner(true);
$partner->setDb0Company(false);
$partner->setOfficial(true);
$partner->setOver(true);
Partner::$allPartners[] = $partner;
$partner = new Partner();
$partner->setID('sky-fansub');
$partner->setName("Sky-fansub");
$partner->setWebsiteUrl('http://www.sky-fansub.com/');
$partner->setBannerUrl('images/partenaires/sky.png');
$partner->setFansubPartner(true);
$partner->setDb0Company(false);
$partner->setOfficial(true);
Partner::$allPartners[] = $partner;
$partner = new Partner();
$partner->setID('anime-ultime');
$partner->setName("Anime-ultime");
$partner->setWebsiteUrl('http://www.anime-ultime.net/part/Site-93');
$partner->setBannerUrl('images/partenaires/anime-ultime.jpg');
$partner->setFansubPartner(false);
$partner->setDb0Company(true);
$partner->setOfficial(true);
Partner::$allPartners[] = $partner;
$partner = new Partner();
$partner->setID('animeka');
$partner->setName("Animeka");
$partner->setWebsiteUrl('http://animeka.com/fansub/teams/zero.html');
$partner->setBannerUrl('images/partenaires/animeka.jpg');
$partner->setFansubPartner(false);
$partner->setDb0Company(false);
$partner->setOfficial(false);
Partner::$allPartners[] = $partner;
$partner = new Partner();
$partner->setID('maboroshi');
$partner->setName("Maboroshi");
$partner->setWebsiteUrl('http://japanslash.free.fr');
$partner->setFansubPartner(true);
$partner->setDb0Company(false);
$partner->setOfficial(true);
$partner->setOver(true);
Partner::$allPartners[] = $partner;
$partner = new Partner();
$partner->setID('kyoutsu');
$partner->setName("Kyoutsu");
$partner->setWebsiteUrl('http://kyoutsu-subs.over-blog.com');
$partner->setFansubPartner(true);
$partner->setDb0Company(false);
$partner->setOfficial(true);
$partner->setOver(true);
Partner::$allPartners[] = $partner;
$partner = new Partner();
$partner->setID('db0company');
//.........这里部分代码省略.........
示例4: 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;
}