Skip to content

Instantly share code, notes, and snippets.

@lchrusciel
Created April 27, 2018 14:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lchrusciel/ee95a100d0ca5ce7b7e5eb79cf0df6f2 to your computer and use it in GitHub Desktop.
Save lchrusciel/ee95a100d0ca5ce7b7e5eb79cf0df6f2 to your computer and use it in GitHub Desktop.
Sample ProductBundle class
// src/AppBundle/Entity/ProductBundle.php
<?php
declare(strict_types=1);
namespace AppBundle\Entity;
use Sylius\Component\Resource\Model\ResourceInterface;
class ProductBundle implements ResourceInterface
{
/** @var int */
private $id;
/** @var string|null */
private $name;
/** @var string|null */
private $code;
public function getId() // Missing return type due to ResourceInterface restrictions
{
return $this->id;
}
public function getName(): ?string
{
return $this->name;
}
public function setName(?string $name): void
{
$this->name = $name;
}
public function getCode(): ?string
{
return $this->code;
}
public function setCode(?string $code): void
{
$this->code = $code;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment