<?php

class ProjectNewsTypes extends Eloquent {
  
	protected $table    	 = 'project_news_types';
	protected $softDelete	 = true;
	protected $guarded		 = array();
	public static $rules	 = array();

	public function projectNews() {
		return $this->hasMany('ProjectNews');
	}
	
	public static function getAllTypes() {
		$types = array();
		foreach (ProjectNewsTypes::all() as $item) {
			$types[$item->id] = $item->name.( ($item->type) ? ": {$item->type}" : "");
		}
		return $types;
	}
}