public function setPosition($position)
    {
        if ($position === null) {
            $this->position = null;
            return $this;
        }

        if (!is_numeric($position)) {
            throw new InvalidArgumentException(
                'Position must be an integer.'
            );
        }

        $this->position = (int)$position;

        return $this;
    }
public function setPosition($position)
    {
        if ($position === null) {
            $this->position = null;
            return $this;
        }

        if (!is_numeric($position)) {
            throw new InvalidArgumentException(
                'Position must be an integer.'
            );
        }

        $this->position = (int)$position;

        return $this;
    }
public function setPosition ( $ position ) { if ( $ position === null ) { $ this -> position = null ; return $ this ; } if ( ! is_numeric ( $ position ) ) { throw new InvalidArgumentException ( 'Position must be an integer.' ) ; } $ this -> position = ( int ) $ position ; return $ this ; }
Set the relationship's position.

Define the relation's sorting position amongst other attachments
related to the source object and grouping.

@param  integer $position A position.
@throws InvalidArgumentException If the position is not an integer (or numeric integer string).
@return self
Set the relationship s position .