Exemple #1
0
 public function testFilterTableWithoutPk()
 {
     $table = new Table($this->connection, 'psx_handler_comment', array('name' => TableInterface::TYPE_VARCHAR));
     $filter = new PrimaryKey($table);
     $this->assertEquals(false, $filter->apply(1));
     $this->assertEquals(false, $filter->apply(32));
 }
Exemple #2
0
 public static function createSampleSite($label)
 {
     $site = new Site();
     $v4PK = new PrimaryKey();
     $site->setPrimaryKey($v4PK->getId());
     $site->setShortName($label);
     return $site;
 }
Exemple #3
0
 /**
  * Whether or not the row has a complete primary key.
  * 
  * @return boolean
  */
 public final function HasPrimaryKey()
 {
     return count(array_filter($this->PrimaryKey->GetData(), function ($Value) {
         return $Value !== null;
     })) === $this->PrimaryKeyColumnsAmount;
 }