示例#1
0
 public function testIfSessionCanAddEntity()
 {
     $project = new Project();
     $project->setName('My Project');
     $this->session->addEntity($project);
     $this->assertTrue($this->session->isAdded($project));
 }
示例#2
0
文件: Simdal.php 项目: andho/simdal
 public function init()
 {
     $autoloader = Zend_Loader_Autoloader::getInstance();
     $autoloader->registerNamespace('SimDAL_');
     SimDAL_Autoload::setDomainDirectory($this->domainPath);
     SimDAL_Autoload::loadNonDomainClasses(false);
     SimDAL_Session::factory(array('db' => $this->adapterConfig));
     $autoloader->pushAutoloader(array('SimDAL_Autoload', 'autoload'));
 }
示例#3
0
<?php

require_once 'init.php';
$mapper = SimDAL_Session::factory()->getMapper();
SimDAL_ProxyGenerator::generateProxies($mapper, DOMAIN_PATH . DIRECTORY_SEPARATOR . '.simdal');
示例#4
0
文件: init.php 项目: andho/simdal
<?php

$domain_path = realpath(dirname(__FILE__) . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'TestDomain');
define('DOMAIN_PATH', $domain_path);
if (!isset($paths)) {
    $paths = array('curr_path' => get_include_path());
    $autoload = true;
}
if (!isset($dir)) {
    $paths['library'] = realpath(DOMAIN_PATH . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'library');
    $paths['domain'] = DOMAIN_PATH;
    $paths = array_reverse($paths, true);
    set_include_path(implode(PATH_SEPARATOR, $paths));
}
if ($autoload) {
    require_once 'SimDAL/Autoload.php';
    SimDAL_Autoload::setDomainDirectory(DOMAIN_PATH);
    spl_autoload_register(array('SimDAL_Autoload', 'autoload'));
}
SimDAL_Session::factory(include 'config.php');
示例#5
0
文件: Session.php 项目: andho/simdal
 protected function _startHookSession()
 {
     $this->_hookSession = SimDAL_Session::factory()->getNewSession();
 }