src/Charcoal/Admin/Script/Object/Table/AlterPrimaryKeyScript.php
protected function labelFromMode($mode)
    {
        if ($mode instanceof IdProperty) {
            $mode = $mode->mode();
        }

        switch ($mode) {
            case IdProperty::MODE_AUTO_INCREMENT:
                return 'auto-increment';

            case IdProperty::MODE_UNIQID:
                return 'uniqid()';

            case IdProperty::MODE_UUID:
                return 'RFC-4122 UUID';

            case IdProperty::MODE_CUSTOM:
                return 'custom';
        }

        throw new UnexpectedValueException(sprintf(
            'The ID mode was not recognized: %s',
            is_object($mode) ? get_class($mode) : gettype($mode)
        ));
    }
protected function labelFromMode($mode)
    {
        if ($mode instanceof IdProperty) {
            $mode = $mode->mode();
        }

        switch ($mode) {
            case IdProperty::MODE_AUTO_INCREMENT:
                return 'auto-increment';

            case IdProperty::MODE_UNIQID:
                return 'uniqid()';

            case IdProperty::MODE_UUID:
                return 'RFC-4122 UUID';

            case IdProperty::MODE_CUSTOM:
                return 'custom';
        }

        throw new UnexpectedValueException(sprintf(
            'The ID mode was not recognized: %s',
            is_object($mode) ? get_class($mode) : gettype($mode)
        ));
    }
protected function labelFromMode ( $ mode ) { if ( $ mode instanceof IdProperty ) { $ mode = $ mode -> mode ( ) ; } switch ( $ mode ) { case IdProperty :: MODE_AUTO_INCREMENT : return 'auto-increment' ; case IdProperty :: MODE_UNIQID : return 'uniqid()' ; case IdProperty :: MODE_UUID : return 'RFC-4122 UUID' ; case IdProperty :: MODE_CUSTOM : return 'custom' ; } throw new UnexpectedValueException ( sprintf ( 'The ID mode was not recognized: %s' , is_object ( $ mode ) ? get_class ( $ mode ) : gettype ( $ mode ) ) ) ; }
Retrieve a label for the ID's mode.

@param  string|IdProperty $mode The mode or property to resolve.
@throws UnexpectedValueException If the ID mode is invalid.
@return string
Retrieve a label for the ID s mode .