RedUNIT\Base\Tags::fetchTaggedItems PHP Method

fetchTaggedItems() public method

Fetching tagged items.
public fetchTaggedItems ( ) : void
return void
    public function fetchTaggedItems()
    {
        $b = R::dispense("book");
        $b->title = 'horror';
        R::store($b);
        $c = R::dispense("book");
        $c->title = 'creepy';
        R::store($c);
        $d = R::dispense("book");
        $d->title = "chicklit";
        R::store($d);
        R::tag($b, "horror,classic");
        R::tag($d, "women,classic");
        R::tag($c, "horror");
        $x = R::tagged("book", "classic");
        asrt(count($x), 2);
        $x = R::tagged("book", "classic,horror");
        asrt(count($x), 3);
        $x = R::tagged("book", array("classic", "horror"));
        asrt(count($x), 3);
    }