示例#1
0
 /**
  * Initializes a new instance of the <tt>ProxyFactory</tt> class that is
  * connected to the given <tt>EntityManager</tt>.
  *
  * @param EntityManager $em The EntityManager the new factory works for.
  * @param string $proxyDir The directory to use for the proxy classes. It must exist.
  * @param string $proxyNs The namespace to use for the proxy classes.
  * @param boolean $autoGenerate Whether to automatically generate proxy classes.
  */
 public function __construct(EntityManager $em, $proxyDir, $proxyNs, $autoGenerate = false)
 {
     if (!$proxyDir) {
         throw ProxyException::proxyDirectoryRequired();
     }
     if (!$proxyNs) {
         throw ProxyException::proxyNamespaceRequired();
     }
     $this->_em = $em;
     $this->_proxyDir = $proxyDir;
     $this->_autoGenerate = $autoGenerate;
     $this->_proxyNamespace = $proxyNs;
 }