factory() public static method

Static method to instantiate the SQL object and return itself to facilitate chaining methods together.
public static factory ( Db $db, mixed $table = null, string $alias = null ) : Sql
$db Db
$table mixed
$alias string
return Sql
Exemplo n.º 1
0
 public function testIsNotNull()
 {
     $p = new Predicate(Sql::factory(Db::factory('Sqlite', array('database' => __DIR__ . '/../tmp/test.sqlite')), 'users'));
     $p->isNotNull('email');
     $this->assertEquals('("email" IS NOT NULL)', (string) $p);
 }
Exemplo n.º 2
0
 public function testConstructor()
 {
     $this->assertInstanceOf('Pop\\Db\\Sql', new Sql(Db::factory('Sqlite', array('database' => __DIR__ . '/../tmp/test.sqlite')), 'users'));
     $this->assertInstanceOf('Pop\\Db\\Sql', Sql::factory(Db::factory('Sqlite', array('database' => __DIR__ . '/../tmp/test.sqlite')), 'users'));
 }