Conversation
|
I add conflict but I have a pb with namespace I will to correct |
|
It's good :) |
| $model_name = "${class}Model"; | ||
| } | ||
|
|
||
| if (!class_exists($model_name)) { |
There was a problem hiding this comment.
Might be worth to move it up a bit. As it doesn't require the session to exit.
| break; | ||
| default: | ||
| $type = Type::BUILTIN_TYPE_OBJECT; | ||
| $name = $pomm_type; |
| */ | ||
| public function normalize($object, $format = null, array $context = array()) | ||
| { | ||
| return $object->extract(); |
There was a problem hiding this comment.
I would build an stdClass and forward it to a the normalizer again. (By implementing NormalizerAwareInterface)
| /** | ||
| * @param Pomm $pomm | ||
| * | ||
| * @return null |
| public function __construct($unused = null, Stopwatch $stopwatch = null) | ||
| { | ||
| if ($unused !== null) { | ||
| trigger_error("The parameter Pomm has been deleted for to delete the high dependency.", E_USER_DEPRECATED); |
There was a problem hiding this comment.
Maybe rephrase it to The Pomm parameter has been deleted in order to remove the higher dependency or somethin ?
| * @param array $data | ||
| * @param $session | ||
| * | ||
| * @return null |
| /** | ||
| * @param string $name | ||
| * @param array $data | ||
| * @param $session |
| if (isset($context['model:name'])) { | ||
| $model_name = $context['model:name']; | ||
| } else { | ||
| $model_name = "${class}Model"; |
There was a problem hiding this comment.
I prefer the
$model_name = "{$class}Model";syntax as it allows the use of sub properties or function calls
| } | ||
|
|
||
| if (!class_exists($model_name)) { | ||
| return; |
There was a problem hiding this comment.
Would add a warning in the logs could be usefull here ?
| if (isset($context['model:name'])) { | ||
| $model_name = $context['model:name']; | ||
| } else { | ||
| $model_name = "${class}Model"; |
There was a problem hiding this comment.
same thing, I prefer the
$model_name = "{$class}Model";syntax as it allows the use of sub properties or function calls
| $model_name = "${class}Model"; | ||
| } | ||
|
|
||
| if (!class_exists($model_name)) { |
There was a problem hiding this comment.
Might be worth to move it up a bit. As it doesn't require the session to exit.
| if (isset($context['model:name'])) { | ||
| $model_name = $context['model:name']; | ||
| } else { | ||
| $model_name = "${class}Model"; |
| $interfaces = $reflection->getInterfaces(); | ||
|
|
||
| // @TODO Use FlexibleEntityInterface::class with php >= 5.5 | ||
| return isset($interfaces['PommProject\ModelManager\Model\FlexibleEntity\FlexibleEntityInterface']); |
There was a problem hiding this comment.
Couldn't we achieve the same result with is_subclass_of ?
|
After reflexion, I'm wondering if it's a good solution. In the futur, if we want develop a new Bundle with a new component Pomm (other ModelManager for example) we will to duplicate the code. |
No description provided.