public function testUpdatePks() { $orgRc = $this->registry->schema->getResourceClass('organization'); $id0 = $this->newEntityId(); $id1 = $this->newEntityId(); $newOrgs = self::keyById($this->storage->saveItems(array(array('ID' => $id0, 'name' => 'Test Org ' . $id0)), $orgRc, array(EarthIT_Storage_ItemSaver::RETURN_SAVED => true))); $updated = self::keyById($this->storage->updateItems(array('ID' => $id1), $orgRc, EarthIT_Storage_ItemFilters::byId($id0, $orgRc), array(EarthIT_Storage_ItemUpdater::RETURN_UPDATED => true)), $orgRc); $this->assertEquals(array($id1 => array('ID' => $id1, 'name' => 'Test Org ' . $id0, 'office location' => null)), $updated); }
public static function getItemsById(array $ids, EarthIT_Schema_ResourceClass $rc, EarthIT_Storage_ItemSearcher $storage, array $options = array()) { $filter = EarthIT_Storage_ItemFilters::byId($ids, $rc); $search = new EarthIT_Storage_Search($rc, $filter); return $storage->searchItems($search, $options); }