public function determineFormDisplayStrategy(ModelRelationData $data)
    {
        $type = null;

        switch ($data->type) {

            case RelationType::BELONGS_TO:
            case RelationType::BELONGS_TO_THROUGH:
            case RelationType::MORPH_ONE:
            case RelationType::HAS_ONE:
                $type = FormDisplayStrategy::RELATION_SINGLE_AUTOCOMPLETE;
                break;

            case RelationType::BELONGS_TO_MANY:
            case RelationType::HAS_MANY:
            case RelationType::MORPH_MANY:
            case RelationType::MORPH_TO_MANY:
            case RelationType::MORPHED_BY_MANY:
                $type = FormDisplayStrategy::RELATION_PLURAL_AUTOCOMPLETE;
                break;

            case RelationType::MORPH_TO:
                $type = FormDisplayStrategy::RELATION_SINGLE_MORPH_AUTOCOMPLETE;
                break;
        }

        return $type;
    }
public function determineFormDisplayStrategy(ModelRelationData $data)
    {
        $type = null;

        switch ($data->type) {

            case RelationType::BELONGS_TO:
            case RelationType::BELONGS_TO_THROUGH:
            case RelationType::MORPH_ONE:
            case RelationType::HAS_ONE:
                $type = FormDisplayStrategy::RELATION_SINGLE_AUTOCOMPLETE;
                break;

            case RelationType::BELONGS_TO_MANY:
            case RelationType::HAS_MANY:
            case RelationType::MORPH_MANY:
            case RelationType::MORPH_TO_MANY:
            case RelationType::MORPHED_BY_MANY:
                $type = FormDisplayStrategy::RELATION_PLURAL_AUTOCOMPLETE;
                break;

            case RelationType::MORPH_TO:
                $type = FormDisplayStrategy::RELATION_SINGLE_MORPH_AUTOCOMPLETE;
                break;
        }

        return $type;
    }
public function determineFormDisplayStrategy ( ModelRelationData $ data ) { $ type = null ; switch ( $ data -> type ) { case RelationType :: BELONGS_TO : case RelationType :: BELONGS_TO_THROUGH : case RelationType :: MORPH_ONE : case RelationType :: HAS_ONE : $ type = FormDisplayStrategy :: RELATION_SINGLE_AUTOCOMPLETE ; break ; case RelationType :: BELONGS_TO_MANY : case RelationType :: HAS_MANY : case RelationType :: MORPH_MANY : case RelationType :: MORPH_TO_MANY : case RelationType :: MORPHED_BY_MANY : $ type = FormDisplayStrategy :: RELATION_PLURAL_AUTOCOMPLETE ; break ; case RelationType :: MORPH_TO : $ type = FormDisplayStrategy :: RELATION_SINGLE_MORPH_AUTOCOMPLETE ; break ; } return $ type ; }
Determines a form display strategy string for given relation data.

@param ModelRelationData $data
@return string|null
Determines a form display strategy string for given relation data .