code: public function setType( $type )
      {
          if (!in_array( intval( $type ), self::$types )) {
              throw new InvalidArgumentException( sprintf( 'Invalid type (%s)', $type ) );
          }
  
          $this->type = $type;
  
          return $this;
      }
docs: @param  int $type
  
  @return $this