コード例 #1
0
ファイル: ORMModelSDB.php プロジェクト: laiello/flexible-orm
 /**
  * Create the SDB domain for this model
  *
  * This action is idempotent (can be called repeatedly with no side-effect)
  * though it should not be called every time the script is run, since it
  * may be slightly slower.
  * 
  * \note Uses the [AWS]region setting to chose where to create the domain.
  *
  * @return string
  *      Returns the domain name created (will be the same as calling
  *      ORM_Model::TableName())
  */
 public static function CreateDomain()
 {
     $domain_name = static::TableName();
     SDBStatement::GetSDBConnection()->create_domain($domain_name);
     return $domain_name;
 }
コード例 #2
0
 protected function tearDown()
 {
     $sdb = \ORM\SDB\SDBStatement::GetSDBConnection();
     $sdb->delete_domain(Mock\File::TableName());
     $sdb->delete_domain(Mock\SDBCar::TableName());
 }
コード例 #3
0
ファイル: TagsTest.php プロジェクト: laiello/flexible-orm
 public function setUp()
 {
     $this->sdb = SDBStatement::GetSDBConnection();
 }
コード例 #4
0
<?php

/**
 * Tests specific to AmazonSDB packages (SDB)
 */
namespace FlexibleORMTests\SDB;

use ORM\SDB\SDBFactory;
use ORM\SDB\SDBStatement;
use FlexibleORMTests\Mock;
use FlexibleORMTests\ORMTest;
set_include_path(get_include_path() . PATH_SEPARATOR . __DIR__ . '/..');
require_once 'ORMTest.php';
$sdb = SDBStatement::GetSDBConnection();
$sdb->delete_domain(Mock\SDBOwner::TableName());
//$sdb->create_domain( '123_mustbeescaped' );
//$sdb->put_attributes(
//    '123_mustbeescaped',
//    'test',
//    array('note' => 'This domain name should be escaped with backticks'));
Mock\SDBCar::CreateDomain();
Mock\SDBOwner::CreateDomain();
$owners = range(1, 12);
foreach ($owners as $owner) {
    $owner = new Mock\SDBOwner(array('name' => 'Jarrod ' . $owner));
    $owner->save();
}
/**
 * Test failures and exceptions for SDBStatement
 *
 * Most of the features are already tested in ORMModelSDBTest