src/CRUDlex/EntityDefinition.php
protected function checkFieldNames($reference, $fieldNames)
    {
        $validFieldNames   = $this->getPublicFieldNames();
        $invalidFieldNames = [];
        foreach ($fieldNames as $fieldName) {
            if (!in_array($fieldName, $validFieldNames)) {
                $invalidFieldNames[] = $fieldName;
            }
        }
        if (!empty($invalidFieldNames)) {
            throw new \InvalidArgumentException('Invalid fields ('.join(', ', $invalidFieldNames).') in '.$reference.', valid ones are: '.join(', ', $validFieldNames));
        }
    }
protected function checkFieldNames($reference, $fieldNames)
    {
        $validFieldNames   = $this->getPublicFieldNames();
        $invalidFieldNames = [];
        foreach ($fieldNames as $fieldName) {
            if (!in_array($fieldName, $validFieldNames)) {
                $invalidFieldNames[] = $fieldName;
            }
        }
        if (!empty($invalidFieldNames)) {
            throw new \InvalidArgumentException('Invalid fields ('.join(', ', $invalidFieldNames).') in '.$reference.', valid ones are: '.join(', ', $validFieldNames));
        }
    }
protected function checkFieldNames ( $ reference , $ fieldNames ) { $ validFieldNames = $ this -> getPublicFieldNames ( ) ; $ invalidFieldNames = [ ] ; foreach ( $ fieldNames as $ fieldName ) { if ( ! in_array ( $ fieldName , $ validFieldNames ) ) { $ invalidFieldNames [ ] = $ fieldName ; } } if ( ! empty ( $ invalidFieldNames ) ) { throw new \ InvalidArgumentException ( 'Invalid fields (' . join ( ', ' , $ invalidFieldNames ) . ') in ' . $ reference . ', valid ones are: ' . join ( ', ' , $ validFieldNames ) ) ; } }
Checks whether the given field names are declared and existing.

@param string $reference
a hint towards the source of an invalid field name
@param array $fieldNames
the field names to check
@throws \InvalidArgumentException
thrown with all invalid field names
Checks whether the given field names are declared and existing .