コード例 #1
0
 /**
  * Initializes a new instance of the <tt>ProxyFactory</tt> class that is
  * connected to the given <tt>DocumentManager</tt>.
  *
  * @param DocumentManager $dm The DocumentManager 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(DocumentManager $dm, $proxyDir, $proxyNs, $autoGenerate = false)
 {
     if (!$proxyDir) {
         throw ProxyException::proxyDirectoryRequired();
     }
     if (!$proxyNs) {
         throw ProxyException::proxyNamespaceRequired();
     }
     $this->dm = $dm;
     $this->proxyDir = $proxyDir;
     $this->autoGenerate = $autoGenerate;
     $this->proxyNamespace = $proxyNs;
 }