forProject() public static method

Returns the custom fields for the specified project.
public static forProject ( integer $project_id ) : array
$project_id integer
return array
コード例 #1
0
ファイル: TicketListing.php プロジェクト: nirix/traq
 public function __construct()
 {
     parent::__construct();
     $this->addCrumb($this->translate('tickets'), $this->generateUrl('tickets'));
     // Custom fields
     $this->customFields = CustomField::forProject($this->currentProject['id']);
     $this->set('customFields', $this->customFields);
 }
コード例 #2
0
ファイル: TicketFilters.php プロジェクト: dasklney/traq
 /**
  * Returns an array of custom field ticket filters for the specified project.
  *
  * @param Project $project
  *
  * @return array
  */
 public static function customFieldFiltersFor(Project $project)
 {
     static $filters = [];
     if (count($filters)) {
         return $filters;
     }
     foreach (CustomField::forProject($project->id) as $field) {
         $filters[$field->slug] = $field->name;
     }
     return $filters;
 }