public static function tag(RedBean_OODBBean $bean, $tagList = null) { if (is_null($tagList)) { $tags = RedBean_Facade::related($bean, 'tag'); $foundTags = array(); foreach ($tags as $tag) { $foundTags[] = $tag->title; } return $foundTags; } RedBean_Facade::clearRelations($bean, 'tag'); RedBean_Facade::addTags($bean, $tagList); }
public static function tag(RedBean_OODBBean $bean, $tagList = null) { if (is_null($tagList)) { $tags = RedBean_Facade::related($bean, "tag"); $foundTags = array(); foreach ($tags as $tag) { $foundTags[] = $tag->title; } if (self::$flagUseLegacyTaggingAPI) { return implode(",", $foundTags); } return $foundTags; } RedBean_Facade::clearRelations($bean, "tag"); RedBean_Facade::addTags($bean, $tagList); }