Пример #1
0
 /**
  * Delete all the statements with predicate p for this resource from 
  * its associated model.
  *
  * @access	public 
  * @param	object	resource $property
  * @return	object ResResource 
  */
 function removeAll($property = null)
 {
     foreach ($this->model->find($this, $property, null) as $statement) {
         $this->model->remove($statement);
     }
     return $this;
 }
Пример #2
0
 /**
  * tests if find() finds a statement in ResModel
  */
 function testNotFindTest()
 {
     $_SESSION['test'] = 'no match test';
     $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/SubX');
     $resPred = new ResResource('http://www.example.org/predX');
     $resObj = new ResResource('http://www.example.org/obX');
     for ($i = -1; $i < 4; $i++) {
         $model1 = $this->_generateModel(100, 2, $i, $needle);
         $resmodel = new ResModel($model1);
         $res = $resmodel->find($resSub, null, null);
         $this->assertEqual(0, count($res));
     }
     $model1->close();
 }