本文整理汇总了PHP中thebuggenie\core\entities\Project::setUsePrefix方法的典型用法代码示例。如果您正苦于以下问题:PHP Project::setUsePrefix方法的具体用法?PHP Project::setUsePrefix怎么用?PHP Project::setUsePrefix使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类thebuggenie\core\entities\Project
的用法示例。
在下文中一共展示了Project::setUsePrefix方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: runDoImportCSV
//.........这里部分代码省略.........
case self::CSV_TYPE_CLIENTS:
for ($i = 0; $i != count($data); $i++) {
try {
$activerow = $data[$i];
$client = new entities\Client();
$client->setName($activerow[self::CSV_CLIENT_NAME]);
if (isset($activerow[self::CSV_CLIENT_EMAIL])) {
$client->setEmail($activerow[self::CSV_CLIENT_EMAIL]);
}
if (isset($activerow[self::CSV_CLIENT_WEBSITE])) {
$client->setWebsite($activerow[self::CSV_CLIENT_WEBSITE]);
}
if (isset($activerow[self::CSV_CLIENT_FAX])) {
$client->setFax($activerow[self::CSV_CLIENT_FAX]);
}
if (isset($activerow[self::CSV_CLIENT_TELEPHONE])) {
$client->setTelephone($activerow[self::CSV_CLIENT_TELEPHONE]);
}
$client->save();
} catch (\Exception $e) {
$errors[] = $this->getI18n()->__('Row %row failed: %err', array('%row' => $i + 1, '%err' => $e->getMessage()));
}
}
break;
case self::CSV_TYPE_PROJECTS:
for ($i = 0; $i != count($data); $i++) {
try {
$activerow = $data[$i];
$project = new entities\Project();
$project->setName($activerow[self::CSV_PROJECT_NAME]);
$project->save();
if (isset($activerow[self::CSV_PROJECT_PREFIX])) {
$project->setPrefix($activerow[self::CSV_PROJECT_PREFIX]);
$project->setUsePrefix(true);
}
if (isset($activerow[self::CSV_PROJECT_SCRUM])) {
if ($activerow[self::CSV_PROJECT_SCRUM] == '1') {
$project->setUsesScrum(true);
}
}
if (isset($activerow[self::CSV_PROJECT_OWNER]) && isset($activerow[self::CSV_PROJECT_OWNER_TYPE])) {
switch ($activerow[self::CSV_PROJECT_OWNER_TYPE]) {
case self::CSV_IDENTIFIER_TYPE_USER:
$user = new entities\User($activerow[self::CSV_PROJECT_OWNER]);
$project->setOwner($user);
break;
case self::CSV_IDENTIFIER_TYPE_TEAM:
$team = new entities\Team($activerow[self::CSV_PROJECT_OWNER]);
$project->setOwner($team);
break;
}
}
if (isset($activerow[self::CSV_PROJECT_LEAD]) && isset($activerow[self::CSV_PROJECT_LEAD_TYPE])) {
switch ($activerow[self::CSV_PROJECT_LEAD_TYPE]) {
case self::CSV_IDENTIFIER_TYPE_USER:
$user = new entities\User($activerow[self::CSV_PROJECT_LEAD]);
$project->setLeader($user);
break;
case self::CSV_IDENTIFIER_TYPE_TEAM:
$team = new entities\Team($activerow[self::CSV_PROJECT_LEAD]);
$project->setLeader($team);
break;
}
}
if (isset($activerow[self::CSV_PROJECT_QA]) && isset($activerow[self::CSV_PROJECT_QA_TYPE])) {
switch ($activerow[self::CSV_PROJECT_QA_TYPE]) {