/** * Determine whether this resource has any values for a given property. * * @param ResResource $property * @param ResResource $value * @return object ResResource * @access public */ function hasProperty($property, $value = null) { $ret = $this->model->findFirstMatchingStatement($this, $property, $value); return $ret !== null; }
function testFindFirstNullTest() { $_SESSION['test'] = 'find first match null'; $model1 = new MemModel(); $needle = new Statement(new Resource('http://www.example.org/Subject3'), new Resource('http://www.example.org/pred'), new Resource('http://www.example.org/ob')); $resSub = new ResResource('http://www.example.org/Subject0'); $resPred = new ResResource('http://www.example.org/Predicate0'); $resObj = new ResResource('http://www.example.org/Object0'); for ($i = -1; $i < 4; $i++) { $model1 = $this->_generateModel(100, 2, $i, $needle); $resmodel = new ResModel($model1); $res = $resmodel->findFirstMatchingStatement(null, null, null); $should = $model1->triples[0]->getSubject(); $sub = $res->getSubject(); $this->assertEqual($sub->uri, $should->getLabel()); } $model1->close(); }