本文整理汇总了PHP中Issue类的典型用法代码示例。如果您正苦于以下问题:PHP Issue类的具体用法?PHP Issue怎么用?PHP Issue使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Issue类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testGetIssueId
public function testGetIssueId()
{
$testIssueId = 'T-2';
$xml = simplexml_load_file($this->filename);
$issue = new Issue($xml);
$this->assertEquals($testIssueId, $issue->getId());
}
示例2: store
public function store()
{
$validator = Validator::make(Input::all(), Issue::$rules, Issue::$messages);
//if($validator->passes()){
$issue = new Issue();
$issue->summary = Input::get('summary');
$issue->detail = Input::get('detail');
$issue->budget = 0.0;
$issue->currentState = "TO-DO";
$issue->points = Input::get('points');
$issue->labels = Input::get('labels');
$issue->iterationid = Input::get('iterationid');
$categoryId = Input::get('categoryid');
if ($categoryId == 0) {
//crear categoria
$category = new Category();
$category->name = Input::get('category_name');
$category->save();
$issue->categoryid = $category->id;
} else {
$issue->categoryid = $categoryId;
}
$issue->save();
return Redirect::to('/iterations/' . $issue->iterationid)->with('message', 'Historia creada con exito');
/*}else{
return Redirect::to('iterations/'. Input::get('iterationid'))
->with('error', 'Ocurrieron los siguientes errores')
->withErrors($validator)
->withInput();
}*/
}
示例3: destroy
function destroy()
{
# @issue_count = @category.issues.size
# if @issue_count == 0
# # No issue assigned to this category
# @category.destroy
# redirect_to :controller => 'projects', :action => 'settings', :id => @project, :tab => 'categories'
# elsif params[:todo]
# reassign_to = @project.issue_categories.find_by_id(params[:reassign_to_id]) if params[:todo] == 'reassign'
# @category.destroy(reassign_to)
# redirect_to :controller => 'projects', :action => 'settings', :id => @project, :tab => 'categories'
# end
App::import('model', 'Issue');
$Issue = new Issue();
$issue_count = $Issue->find('count', aa('conditions', aa('category_id', $this->params['id'])));
if ($issue_count == 0) {
$this->IssueCategory->del($this->params['id']);
$this->redirect(aa('controller', 'projects', 'action', 'settings', 'project_id', $this->_project['Project']['identifier'], '?', 'tab=categories'));
} elseif ($this->data) {
$reassgin_to = null;
if ($this->data['IssueCategory']['todo'] == 'reassgin_to') {
$reassgin_to = $this->data['IssueCategory']['reassign_to_id'];
}
$this->IssueCategory->del_with_reassgin($this->params['id'], $reassgin_to);
$this->redirect(aa('controller', 'projects', 'action', 'settings', 'project_id', $this->_project['Project']['identifier'], '?', 'tab=categories'));
}
$issue_category_data = $this->IssueCategory->find('first', aa('conditions', aa('IssueCategory.id', $this->params['id'])));
$this->set('issue_category_data', $issue_category_data);
$this->set('issue_count', $issue_count);
}
示例4: setIssueAndChanges
public function setIssueAndChanges(Issue $issue, array $old_values)
{
$this->Issue = $issue;
$this->exists = $issue->exists();
$this->modified = $issue->getModified();
$this->old_values = $old_values;
}
示例5: transform
/**
* Transforms an object (issue) to a string (number).
*
* @param Issue|null $issue
* @return string
*/
public function transform($issue)
{
if (null === $issue) {
return "";
}
return $issue->getusername();
}
示例6: transform
/**
* Transforms an object (issue) to a string (number).
*
* @param Issue|null $issue
* @return string
*/
public function transform($issue)
{
if (null === $issue) {
return '';
}
return $issue->getId();
}
示例7: GetURI
public static function GetURI($p_publicationId, $p_languageId, $p_issueNo = null, $p_sectionNo = null, $p_articleNo = null)
{
$translator = \Zend_Registry::get('container')->getService('translator');
$languageObj = new Language($p_languageId);
if (!$languageObj->exists()) {
return new PEAR_Error($translator->trans('Language does not exist.'));
}
$uri = '/' . $languageObj->getCode() . '/';
if (!is_null($p_issueNo) && is_null($p_articleNo)) {
$issueObj = new Issue($p_publicationId, $p_languageId, $p_issueNo);
if (!$issueObj->exists()) {
return new PEAR_Error($translator->trans('Issue does not exist.'));
}
$uri .= $issueObj->getUrlName() . '/';
}
if (!is_null($p_sectionNo) && is_null($p_articleNo)) {
$sectionObj = new Section($p_publicationId, $p_issueNo, $p_languageId, $p_sectionNo);
if (!$sectionObj->exists()) {
return new PEAR_Error($translator->trans('Section does not exist.'));
}
$uri .= $sectionObj->getUrlName() . '/';
}
if (!is_null($p_articleNo)) {
$articleObj = new Article($p_languageId, $p_articleNo);
if (!$articleObj->exists()) {
return new PEAR_Error($translator->trans('Article does not exist.'));
}
$issueObj = new Issue($p_publicationId, $p_languageId, $articleObj->getIssueNumber());
$sectionObj = new Section($p_publicationId, $articleObj->getIssueNumber(), $p_languageId, $articleObj->getSectionNumber());
$uri .= $issueObj->getUrlName() . '/';
$uri .= $sectionObj->getUrlName() . '/';
$uri .= $articleObj->getUrlName() . '/';
}
return $uri;
}
示例8: setIssue
/**
* The setter of the field issue_id.
* @param Issue $issue - the issue related to the reply
*/
public function setIssue(Issue $issue)
{
if ($issue == NULL) {
throw new InvalidArgumentException('[Model\\IssueReply] Invalid Model\\Issue.');
}
$this->issue_id = $issue->getIssueId();
}
示例9: transform
/**
* Transforms an object (issue) to a string (number).
*
* @param Issue|null $entity
* @return string
*/
public function transform($entity)
{
if (null === $entity) {
return '';
}
return $entity->getId();
}
示例10: __construct
/**
* @param Issue $issue
* @param string $file
* @param int $line
* @param array $template_parameters
*/
public function __construct(Issue $issue, string $file, int $line, array $template_parameters)
{
$this->issue = $issue;
$this->file = $file;
$this->line = $line;
$this->message = vsprintf($issue->getTemplate(), $template_parameters);
}
示例11: transform
/**
* Transforms an object (roles) to a string (choice).
*
* @param Issue|null $roles
* @return string
*/
public function transform($roles)
{
if (null === $roles) {
return "";
}
return $roles->getNumber();
}
示例12: GetURI
public static function GetURI($p_publicationId, $p_languageId, $p_issueNo = null, $p_sectionNo = null, $p_articleNo = null)
{
$languageObj = new Language($p_languageId);
if (!$languageObj->exists()) {
return new PEAR_Error(getGS('Language does not exist.'));
}
$uri = $GLOBALS['Campsite']['SUBDIR'] . '/' . $languageObj->getCode() . '/';
if (!is_null($p_issueNo) && is_null($p_articleNo)) {
$issueObj = new Issue($p_publicationId, $p_languageId, $p_issueNo);
if (!$issueObj->exists()) {
return new PEAR_Error(getGS('Issue does not exist.'));
}
$uri .= $issueObj->getUrlName() . '/';
}
if (!is_null($p_sectionNo) && is_null($p_articleNo)) {
$sectionObj = new Section($p_publicationId, $p_issueNo, $p_languageId, $p_sectionNo);
if (!$sectionObj->exists()) {
return new PEAR_Error(getGS('Section does not exist.'));
}
$uri .= $sectionObj->getUrlName() . '/';
}
if (!is_null($p_articleNo)) {
$articleObj = new Article($p_languageId, $p_articleNo);
if (!$articleObj->exists()) {
return new PEAR_Error(getGS('Article does not exist.'));
}
$issueObj = new Issue($p_publicationId, $p_languageId, $articleObj->getIssueNumber());
$sectionObj = new Section($p_publicationId, $articleObj->getIssueNumber(), $p_languageId, $articleObj->getSectionNumber());
$uri .= $issueObj->getUrlName() . '/';
$uri .= $sectionObj->getUrlName() . '/';
$uri .= $articleObj->getUrlName() . '/';
}
return $uri;
}
示例13: transform
/**
* Transforms an object (model) to a string (id).
*
* @param Issue|null $model
* @return string
*/
public function transform($model)
{
if (null === $model) {
return '';
}
return $model->getId();
}
示例14: getTemplate
protected function getTemplate()
{
if ($this->m_dbObject->getSectionTemplateId() > 0) {
return new MetaTemplate($this->m_dbObject->getSectionTemplateId());
}
$sectionIssue = new Issue($this->m_dbObject->getProperty('IdPublication'), $this->m_dbObject->getProperty('IdLanguage'), $this->m_dbObject->getProperty('NrIssue'));
return new MetaTemplate($sectionIssue->getSectionTemplateId());
}
示例15: transform
/**
* Transforms an object (issue) to a string (number).
*
* @param Issue|null $issue
* @return string
*/
public function transform($issue)
{
if (null === $issue) {
return '';
}
$this->id = $issue->getId();
return $issue->getFirstName() . " " . $issue->getSurname() . "(" . $issue->getAddress() . ")";
}