# GoogleChartSolidFill.class.php

Go to the documentation of this file.

    00001 <?php
    00002 /***************************************************************************
    00003  *   Copyright (C) 2009 by Denis M. Gabaidulin                             *
    00004  *                                                                         *
    00005  *   This program is free software; you can redistribute it and/or modify  *
    00006  *   it under the terms of the GNU Lesser General Public License as        *
    00007  *   published by the Free Software Foundation; either version 3 of the    *
    00008  *   License, or (at your option) any later version.                       *
    00009  *                                                                         *
    00010  ***************************************************************************/
    00011
    00015     final class GoogleChartSolidFill extends BaseGoogleChartParameter
    00016     {
    00017         protected static $paramName = 'chf';
    00018
    00019         private $type   = null;
    00020         private $color  = null;
    00021
    00025         public static function create(GoogleChartSolidFillType $type)
    00026         {
    00027             return new self($type);
    00028         }
    00029
    00030         public function __construct(GoogleChartSolidFillType $type)
    00031         {
    00032             $this->type = $type;
    00033         }
    00034
    00038         public function setColor(Color $color)
    00039         {
    00040             $this->color = $color;
    00041
    00042             return $this;
    00043         }
    00044
    00048         public function getColor()
    00049         {
    00050             return $this->color;
    00051         }
    00052
    00053         public function toString()
    00054         {
    00055             Assert::isNotNull($this->color, 'Color parameter required!');
    00056
    00057             return
    00058                 $this->type->toString()
    00059                 .',s'
    00060                 .','.$this->color->toString();
    00061         }
    00062
    00063
    00064         public static function getParamName()
    00065         {
    00066             return self::$paramName;
    00067         }
    00068     }
    00069 ?>