src/Entity/Salary.php
public function setUnit($unit)
    {
        $validUnits = self::getValidUnits();

        if (!in_array($unit, $validUnits)) {
            throw new \InvalidArgumentException('Unknown value for time unit interval.');
        }

        $this->unit = $unit;

        return $this;
    }
public function setUnit($unit)
    {
        $validUnits = self::getValidUnits();

        if (!in_array($unit, $validUnits)) {
            throw new \InvalidArgumentException('Unknown value for time unit interval.');
        }

        $this->unit = $unit;

        return $this;
    }
public function setUnit ( $ unit ) { $ validUnits = self :: getValidUnits ( ) ; if ( ! in_array ( $ unit , $ validUnits ) ) { throw new \ InvalidArgumentException ( 'Unknown value for time unit interval.' ) ; } $ this -> unit = $ unit ; return $ this ; }
Sets time interval unit.

@param string $unit
@throws \InvalidArgumentException
@return $this
Sets time interval unit .