public function getProduct()
{
try {
$sku = $this->product->getSku();
} catch (\Doctrine\ORM\EntityNotFoundException $e) {
return null;
}
return $this->product;
}
/**
* @var \Backend\SalesBundle\Entity\SalesOrder
*
* @ORM\ManyToOne(targetEntity="Backend\CatalogBundle\Entity\CatalogProduct", fetch="EAGER")
* @ORM\JoinColumns({
* @ORM\JoinColumn(name="product_id", referencedColumnName="product_id")
* })
*/
private $product;
$request = $this->get('request');
$session = $request->getSession();
$session = $this->get("session");
<?php
namespace Backend\WorkorderBundle\Entity;
use Doctrine\Common\Collections\ArrayCollection;
use Symfony\Component\Validator\Constraints as Assert;
use Doctrine\ORM\Mapping as ORM;
/**
* Workorder
*
* @ORM\Table(name="workorder")
* @ORM\Entity(repositoryClass="Backend\WorkorderBundle\Entity\WorkorderRepository")
*/
class Workorder
{
//..
/**
* @var integer
*
* @ORM\Column(name="locked_by", type="integer", nullable=true)
*/
private $lockedBy;
/**
* @var \DateTime
*
* @ORM\Column(name="locked_at", type="datetime", nullable=true)
*/
private $lockedAt;
//..
public function __construct()
{
//здесь про эти два объекта ничего
}
//..
/**
* Set lockedBy
*
* @param integer $lockedBy
* @return Workorder
*/
public function setLockedBy($lockedBy)
{
$this->lockedBy = $lockedBy;
return $this;
}
/**
* Get lockedBy
*
* @return integer
*/
public function getLockedBy()
{
return $this->lockedBy;
}
//..