src/Fieldset.php
public function getUniqueFieldNames()
    {
        $results = [ $this->getPrimaryFieldName() ];
        if (!isset($this->data['fields']) || empty($this->data['fields'])) {
            return $results;
        }

        $table = $this->data['name'];
        foreach ($this->data['fields'] as $field) {
            $name = $table . '_' . $field['name'];

            if ($field['field']['type'] === 'uuid') {
                $results[] = $name;
                continue;
            }

            if (!isset($field['validation'])) {
                continue;
            }

            foreach ($field['validation'] as $validation) {
                if ($validation['method'] === 'unique') {
                    $results[] = $name;
                }
            }
        }

        return $results;
    }
public function getUniqueFieldNames()
    {
        $results = [ $this->getPrimaryFieldName() ];
        if (!isset($this->data['fields']) || empty($this->data['fields'])) {
            return $results;
        }

        $table = $this->data['name'];
        foreach ($this->data['fields'] as $field) {
            $name = $table . '_' . $field['name'];

            if ($field['field']['type'] === 'uuid') {
                $results[] = $name;
                continue;
            }

            if (!isset($field['validation'])) {
                continue;
            }

            foreach ($field['validation'] as $validation) {
                if ($validation['method'] === 'unique') {
                    $results[] = $name;
                }
            }
        }

        return $results;
    }
public function getUniqueFieldNames ( ) { $ results = [ $ this -> getPrimaryFieldName ( ) ] ; if ( ! isset ( $ this -> data [ 'fields' ] ) || empty ( $ this -> data [ 'fields' ] ) ) { return $ results ; } $ table = $ this -> data [ 'name' ] ; foreach ( $ this -> data [ 'fields' ] as $ field ) { $ name = $ table . '_' . $ field [ 'name' ] ; if ( $ field [ 'field' ] [ 'type' ] === 'uuid' ) { $ results [ ] = $ name ; continue ; } if ( ! isset ( $ field [ 'validation' ] ) ) { continue ; } foreach ( $ field [ 'validation' ] as $ validation ) { if ( $ validation [ 'method' ] === 'unique' ) { $ results [ ] = $ name ; } } } return $ results ; }
Returns a list of unique fields

@return array
Returns a list of unique fields