public function findObjectType($id)
    {
        $result = [];

        if ($this->getObjectType()->getPropertyDefinition($id) !== null) {
            $result[] = $this->getObjectType();
        }

        $secondaryTypes = $this->getSecondaryTypes();
        if ($secondaryTypes !== null) {
            foreach ($secondaryTypes as $secondaryType) {
                if ($secondaryType->getPropertyDefinition($id) !== null) {
                    $result[] = $secondaryType;
                }
            }
        }

        return empty($result) ? null : $result;
    }
public function findObjectType($id)
    {
        $result = [];

        if ($this->getObjectType()->getPropertyDefinition($id) !== null) {
            $result[] = $this->getObjectType();
        }

        $secondaryTypes = $this->getSecondaryTypes();
        if ($secondaryTypes !== null) {
            foreach ($secondaryTypes as $secondaryType) {
                if ($secondaryType->getPropertyDefinition($id) !== null) {
                    $result[] = $secondaryType;
                }
            }
        }

        return empty($result) ? null : $result;
    }
public function findObjectType ( $ id ) { $ result = [ ] ; if ( $ this -> getObjectType ( ) -> getPropertyDefinition ( $ id ) !== null ) { $ result [ ] = $ this -> getObjectType ( ) ; } $ secondaryTypes = $ this -> getSecondaryTypes ( ) ; if ( $ secondaryTypes !== null ) { foreach ( $ secondaryTypes as $ secondaryType ) { if ( $ secondaryType -> getPropertyDefinition ( $ id ) !== null ) { $ result [ ] = $ secondaryType ; } } } return empty ( $ result ) ? null : $ result ; }
Returns a list of primary and secondary object types that define the given property.

@param string $id the ID of the property
@return ObjectTypeInterface[]|null a list of object types that define the given property or <code>null</code>
if the property could not be found in the object types that are attached to this object
Returns a list of primary and secondary object types that define the given property .