public static function get(array $properties)
    {
        if (!array_key_exists('columns', $properties)) {
            throw new Exception('An index requires at least one column.');
        }

        $index = new Index();

        foreach ((array) $properties['columns'] as $column) {
            $index->addColumn($column);
        }

        if (array_key_exists('name', $properties) && !empty($properties['name'])) {
            $index->setName($properties['name']);
        }

        if (array_key_exists('type', $properties) && !empty($properties['type'])) {
            $index->setType($properties['type']);
        }

        return $index;
    }
public static function get(array $properties)
    {
        if (!array_key_exists('columns', $properties)) {
            throw new Exception('An index requires at least one column.');
        }

        $index = new Index();

        foreach ((array) $properties['columns'] as $column) {
            $index->addColumn($column);
        }

        if (array_key_exists('name', $properties) && !empty($properties['name'])) {
            $index->setName($properties['name']);
        }

        if (array_key_exists('type', $properties) && !empty($properties['type'])) {
            $index->setType($properties['type']);
        }

        return $index;
    }
public static function get ( array $ properties ) { if ( ! array_key_exists ( 'columns' , $ properties ) ) { throw new Exception ( 'An index requires at least one column.' ) ; } $ index = new Index ( ) ; foreach ( ( array ) $ properties [ 'columns' ] as $ column ) { $ index -> addColumn ( $ column ) ; } if ( array_key_exists ( 'name' , $ properties ) && ! empty ( $ properties [ 'name' ] ) ) { $ index -> setName ( $ properties [ 'name' ] ) ; } if ( array_key_exists ( 'type' , $ properties ) && ! empty ( $ properties [ 'type' ] ) ) { $ index -> setType ( $ properties [ 'type' ] ) ; } return $ index ; }
Gets an index from an array.

@var CrestApps\CodeGenerator\Models\Index
Gets an index from an array .