Minor - Add $nameToTranslate to be loaded in json

pull/3890/head
Julio Montoya 4 years ago
parent 1fc6d1c37a
commit 913f345859
  1. 10
      src/CourseBundle/Entity/CTool.php

@ -86,6 +86,11 @@ class CTool extends AbstractResource implements ResourceInterface
*/ */
protected int $position; protected int $position;
/**
* @Groups({"ctool:read"})
*/
protected string $nameToTranslate;
public function __construct() public function __construct()
{ {
$this->position = 0; $this->position = 0;
@ -96,6 +101,11 @@ class CTool extends AbstractResource implements ResourceInterface
return $this->getName(); return $this->getName();
} }
public function getNameToTranslate(): string
{
return ucfirst(str_replace('_', ' ', $this->name));
}
public function getName(): string public function getName(): string
{ {
return $this->name; return $this->name;

Loading…
Cancel
Save