This is an outdated version of the Manual. Visit the NEW Manual


Tags are often used to categorize or group items into meaningful groups. To tag a an item:

::tag$page, array('topsecret','mi6') );

To fetch all tags attached to a certain bean we use the same method but without the tag parameter:

R::tag$page ); //returns array with tags

To untag an item use


To get all beans that have been tagged with $tags, use tagged():

::tagged$beanType$tagList );

To find out whether beans have been tagged with specific tags, use hasTag():


To add tags without removing the old ones:

::addTags$page, array('funny','hilarious') );

To get beans that have ALL these tags: (since 3.2)

//must be tagged with both tags
R::taggedAll$page, array('funny','hilarious') ); 


RedBeanPHP Easy ORM for PHP © 2019 Gabor de Mooij and the RedBeanPHP community - Licensed New BSD/GPLv2