Answer the question
In order to leave comments, you need to log in
Constants for statuses and data types with client-server architecture?
public const TYPES
= [
self::TYPE_TV_SERIES,
self::TYPE_FEATURE_FILM,
self::TYPE_SHORT_FILM,
];
public const TYPES_STR_CONST
= [
self::TYPE_TV_SERIES => 'TYPE_TV_SERIES',
self::TYPE_FEATURE_FILM => 'TYPE_FEATURE_FILM',
self::TYPE_SHORT_FILM => 'TYPE_SHORT_FILM',
];
public function typeStrConst(): string {
return EpisodeType::TYPES_STR_CONST[$this->type->value()];
}
...
<attribute name="typeStrConst" serialized-name="type">
<group>non_sensitive_data</group>
<group>public.info</group>
</attribute>
Answer the question
In order to leave comments, you need to log in
In this particular case, these are not constants, but a separate reference book, which has no place in the code from the word at all
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question