public function attribute($attribute, Report $report=null) {
		if(is_string($attribute))
			$attribute = explode('.', $attribute);

		$next = array_shift($attribute);
		if(!isset($this->attributes[$next]))
			$this->attributes[$next] = new static;

		if($report !== null) {
			if(count($attribute) == 0)
				$this->attributes[$next] = $report;
			else
				$this->attributes[$next]->attribute($attribute, $report);
			return $this;
		}
		else {
			if(count($attribute) == 0)
				return $this->attributes[$next];
			else
				return $this->attributes[$next]->attribute($attribute);
		}
	}
public function attribute($attribute, Report $report=null) {
		if(is_string($attribute))
			$attribute = explode('.', $attribute);

		$next = array_shift($attribute);
		if(!isset($this->attributes[$next]))
			$this->attributes[$next] = new static;

		if($report !== null) {
			if(count($attribute) == 0)
				$this->attributes[$next] = $report;
			else
				$this->attributes[$next]->attribute($attribute, $report);
			return $this;
		}
		else {
			if(count($attribute) == 0)
				return $this->attributes[$next];
			else
				return $this->attributes[$next]->attribute($attribute);
		}
	}
public function attribute ( $ attribute , Report $ report = null ) { if ( is_string ( $ attribute ) ) $ attribute = explode ( '.' , $ attribute ) ; $ next = array_shift ( $ attribute ) ; if ( ! isset ( $ this -> attributes [ $ next ] ) ) $ this -> attributes [ $ next ] = new static ; if ( $ report !== null ) { if ( count ( $ attribute ) == 0 ) $ this -> attributes [ $ next ] = $ report ; else $ this -> attributes [ $ next ] -> attribute ( $ attribute , $ report ) ; return $ this ; } else { if ( count ( $ attribute ) == 0 ) return $ this -> attributes [ $ next ] ; else return $ this -> attributes [ $ next ] -> attribute ( $ attribute ) ; } }
Return an attribute report or set one if provided.
@param  string $attribute attribute name
@param  Report $report    attribute report
@return Report            $this or the attrbute report
Return an attribute report or set one if provided .