forProject() public static method

Returns the custom fields for the specified project.
public static forProject ( integer $project_id ) : array
$project_id integer
return array
Exemplo n.º 1
0
 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);
 }
Exemplo n.º 2
0
 /**
  * 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;
 }