Exemple #1
0
 /**
  * @param SelectorInterface $value
  *
  * @throws \LogicException
  *
  * @return mixed
  */
 protected function createValue(SelectorInterface $value)
 {
     if ($value instanceof Value) {
         $actualValue = $value->value();
         if ($actualValue instanceof EntityInterface) {
             return $actualValue->id();
         }
         if ($actualValue instanceof NativeValueObjectInterface) {
             return $actualValue->toNative();
         }
         return $actualValue;
     }
     throw new \LogicException(\sprintf('The %s selector cannot be used as a value selector', \get_class($value)));
 }