Object::getTags PHP Method

getTags() public static method

Get Tags of the Object
public static getTags ( type $object_id ) : type
$object_id type
return type
    public static function getTags($object_id)
    {
        $req = Yii::app()->db->createCommand("SELECT t.name \n                                    FROM gxc_tag t, gxc_tag_relationships r, gxc_object o\n                                    WHERE t.id = r.tag_id \n                                    AND r.object_id = o.user_id\n                                    AND o.user_id = " . $object_id);
        $tags_name = $req->queryAll();
        $result = array();
        if ($tags_name != null) {
            foreach ($tags_name as $tag_name) {
                $result[] = $tag_name['name'];
            }
        }
        return $result;
    }