src/Charcoal/Source/ExpressionFieldTrait.php
public function setProperty($property)
    {
        if ($property === null) {
            $this->property = $property;
            return $this;
        }

        if ($property instanceof PropertyInterface) {
            if (empty($property->ident())) {
                throw new InvalidArgumentException(
                    'Property must have an identifier.'
                );
            }

            $this->property = $property;
            return $this;
        }

        if (!is_string($property)) {
            throw new InvalidArgumentException(
                'Property must be a string.'
            );
        }

        if ($property === '') {
            throw new InvalidArgumentException(
                'Property can not be empty.'
            );
        }

        $this->property = $property;
        return $this;
    }
public function setProperty($property)
    {
        if ($property === null) {
            $this->property = $property;
            return $this;
        }

        if ($property instanceof PropertyInterface) {
            if (empty($property->ident())) {
                throw new InvalidArgumentException(
                    'Property must have an identifier.'
                );
            }

            $this->property = $property;
            return $this;
        }

        if (!is_string($property)) {
            throw new InvalidArgumentException(
                'Property must be a string.'
            );
        }

        if ($property === '') {
            throw new InvalidArgumentException(
                'Property can not be empty.'
            );
        }

        $this->property = $property;
        return $this;
    }
public function setProperty ( $ property ) { if ( $ property === null ) { $ this -> property = $ property ; return $ this ; } if ( $ property instanceof PropertyInterface ) { if ( empty ( $ property -> ident ( ) ) ) { throw new InvalidArgumentException ( 'Property must have an identifier.' ) ; } $ this -> property = $ property ; return $ this ; } if ( ! is_string ( $ property ) ) { throw new InvalidArgumentException ( 'Property must be a string.' ) ; } if ( $ property === '' ) { throw new InvalidArgumentException ( 'Property can not be empty.' ) ; } $ this -> property = $ property ; return $ this ; }
Set model property key or source field key.

@param  string|PropertyInterface $property The related property.
@throws InvalidArgumentException If the parameter is invalid.
@return self
Set model property key or source field key .