prefix) { return $this->prefix.'.'.$this->read; } return $this->read; } public function getEditOperationName(): string { if ('' !== $this->prefix) { return $this->prefix.'.'.$this->edit; } return $this->edit; } public function getPlaceholder() { //Check if a class name was specified if (class_exists($this->type)) { $object = new $this->type(); if ($object instanceof NamedDBElement) { if (\is_string($this->placeholder) && '' !== $this->placeholder) { $object->setName($this->placeholder); } $object->setName('???'); } return $object; } if (null === $this->placeholder) { switch ($this->type) { case 'integer': return 0; case 'float': return 0.0; case 'string': return '???'; case 'object': return null; case 'collection': return new ArrayCollection(); case 'boolean': return false; case 'datetime': $date = new \DateTime(); return $date->setTimestamp(0); default: throw new InvalidArgumentException('Unknown type! You have to specify a placeholder!'); } } return $this->placeholder; } }