$product = ProductQuery::create()
->joinWithCategory()
->findPk($id);
$categoryName = $product->getCategory()->getName();
public function findOneByIdJoinedToCategory($id)
{
$query = $this->getEntityManager()
->createQuery('
SELECT p, c FROM AcmeStoreBundle:Product p
JOIN p.category c
WHERE p.id = :id'
)->setParameter('id', $id);
try {
return $query->getSingleResult();
} catch (\Doctrine\ORM\NoResultException $e) {
return null;
}
}
[egServer70]
host = 192.168.56.102
port = 1433
tds version = 8.0
client charset = UTF-8
'db'=>array(
'connectionString' => 'dblib:host=egServer70;dbname=inet',
//'emulatePrepare' => false,
'username' => 'www',
'password' => '123',
'charset' => 'utf8'
),
tenzor@tenzor-VirtualBox:~$ ifconfig
eth0 Link encap:Ethernet HWaddr 52:54:00:be:40:70
inet addr:10.0.2.15 Bcast:10.0.2.255 Mask:255.255.255.0
inet6 addr: fe80::5054:ff:febe:4070/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:62979 errors:39 dropped:0 overruns:0 frame:0
TX packets:33941 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:50468792 (50.4 MB) TX bytes:2356865 (2.3 MB)
Interrupt:19 Base address:0xd020
eth1 Link encap:Ethernet HWaddr 08:00:27:c6:f9:d3
inet addr:192.168.56.101 Bcast:192.168.56.255 Mask:255.255.255.0
inet6 addr: fe80::a00:27ff:fec6:f9d3/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:1794 errors:0 dropped:0 overruns:0 frame:0
TX packets:1785 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:225587 (225.5 KB) TX bytes:317669 (317.6 KB)
Interrupt:16 Base address:0xd060
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:4182 errors:0 dropped:0 overruns:0 frame:0
TX packets:4182 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:1179743 (1.1 MB) TX bytes:1179743 (1.1 MB)
VirtualBox Host-Only Ethernet Adapter, собственно по этому IP я и обращаюсь к гостевой ОС из родительской.