Beispiel #1
0
$lnk1->addTag('google');
$lnk1->addTag('com');
$lnk2 = new Link();
$lnk2->setUrl('http://www.mongodb.org');
$lnk2->addTag('mongodb');
$lnk2->addTag('org');
$lnk3 = new Link();
$lnk3->setUrl('http://www.ibuildings.com');
$lnk3->addTag('ibuildings');
$lnk3->addTag('com');
$lnk4 = new Link();
$lnk4->setUrl('http://techportal.ibuildings.com/');
$lnk4->addTag('techportal');
$lnk4->addTag('ibuildings');
$lnk4->addTag('com');
$linkPeer->insert($lnk1);
$linkPeer->insert($lnk2);
$linkPeer->insert($lnk3);
$linkPeer->insert($lnk4);
// Print the entire database
echo "> new entire database :\n";
foreach ($linkPeer->fetchAll() as $link) {
    echo "{$link}\n";
}
echo "\n----\n";
// Print the techportal link
echo "> retrieve the techportal link:\n";
echo $linkPeer->fetchByUrl('http://techportal.ibuildings.com/');
echo "\n----\n";
// Print all com tagged links
echo "> retrieve all 'com' tagged links:\n";