src/Charcoal/Property/IdProperty.php
public function setMode($mode)
    {
        $availableModes = $this->availableModes();
        if (!in_array($mode, $availableModes)) {
            throw new InvalidArgumentException(sprintf(
                'Invalid ID mode. Must be one of "%s"',
                implode(', ', $availableModes)
            ));
        }

        $this->mode = $mode;

        return $this;
    }
public function setMode($mode)
    {
        $availableModes = $this->availableModes();
        if (!in_array($mode, $availableModes)) {
            throw new InvalidArgumentException(sprintf(
                'Invalid ID mode. Must be one of "%s"',
                implode(', ', $availableModes)
            ));
        }

        $this->mode = $mode;

        return $this;
    }
public function setMode ( $ mode ) { $ availableModes = $ this -> availableModes ( ) ; if ( ! in_array ( $ mode , $ availableModes ) ) { throw new InvalidArgumentException ( sprintf ( 'Invalid ID mode. Must be one of "%s"' , implode ( ', ' , $ availableModes ) ) ) ; } $ this -> mode = $ mode ; return $ this ; }
Set the allowed ID mode.

@param string $mode The ID mode ("auto-increment", "custom", "uniqid" or "uuid").
@throws InvalidArgumentException If the mode is not one of the 4 valid modes.
@return self
Set the allowed ID mode .