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)); }
public static function createSampleSite($label) { $site = new Site(); $v4PK = new PrimaryKey(); $site->setPrimaryKey($v4PK->getId()); $site->setShortName($label); return $site; }
/** * 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; }