public function testautoincrementIntoDb() { $aid = 77; $pid = Api_Dao_Photo::createPhoto($aid, 'a caption', '', 2, '', '', ''); $this->assertTrue($pid !== false); $subjectId = 2; $text = "cvsUrl"; $xcoord = 21; $ycoord = 43; $id; try { $numRows = $this->getNumAllPhotoTags(); $id = Api_Dao_PhotoTag::createPhotoTag($pid, $subjectId, $text, $xcoord, $ycoord, null); $this->assertEquals($numRows + 1, $this->getNumAllPhotoTags()); $this->assertNotNull($id); $row = $this->getPhotoTag($id); $this->assertEquals($id, $row['ptid']); $this->assertEquals($pid, $row['pid']); $this->assertEquals($subjectId, $row['subject_id']); $this->assertEquals($text, $row['text']); $this->assertEquals($xcoord, $row['xcoord']); $this->assertEquals($ycoord, $row['ycoord']); } catch (Exception $exception) { throw $exception; } Api_Dao_PhotoTag::deletePhotoTag($id); $this->assertEquals($numRows, $this->getNumAllPhotoTags()); Api_Dao_Photo::deletePhoto($pid); }
public static function getOnePhotoTag($pid, $subjectId, $text, $xcoord, $ycoord) { $id = Api_Dao_PhotoTag::createPhotoTag($pid, $subjectId, $text, $xcoord, $ycoord, null); $tags = Api_Dao_PhotoTag::getPhotoTags(array($id)); if (count($tags) == 1) { return $tags[0]; } return null; }
/** * Enter description here... * * @param unknown_type $pid * @param unknown_type $subjectId * @param unknown_type $text * @param unknown_type $xcoord * @param unknown_type $ycoord * @param unknown_type $created * @return unknown */ public static function createPhotoTag($pid, $subjectId, $text, $xcoord, $ycoord, $created = null) { return Api_Dao_PhotoTag::createPhotoTag($pid, $subjectId, $text, $xcoord, $ycoord, $created); }