/** * __construct * * @param mixed $id The entity identity */ public function __construct($id, $alias = null) { if ($id instanceof EntityInterface) { $id = $id->getId(); } if (!is_int($id)) { throw new InvalidArgumentException(sprintf('The \'id\' argument must be either integer or object of type \'%s\'; \'%s\' given in \'%s\'', EntityInterface::class, is_object($id) ? get_class($id) : gettype($id), __METHOD__)); } parent::__construct(isset($alias) ? $alias . '.id' : 'id', $id); }