private function doMediaJoin($result)
    {
        if (isset($_GET['content_id']) && isset($_GET['content_type'])) {
            $media = $result['data'];
            if (!is_null($media)) {
                //Do join here
                $contentMedia = new ContentMedia();
                $contentMedia->content_id = $_GET['content_id'];
                $contentMedia->content_type = $_GET['content_type'];
                $contentMedia->media_id = $media['id'];
                if ($contentMedia->save(false)) {
                    //success
                    return true;
                } else {
                    return false;
                }
            }
        }

        return true;
    }
private function doMediaJoin($result)
    {
        if (isset($_GET['content_id']) && isset($_GET['content_type'])) {
            $media = $result['data'];
            if (!is_null($media)) {
                //Do join here
                $contentMedia = new ContentMedia();
                $contentMedia->content_id = $_GET['content_id'];
                $contentMedia->content_type = $_GET['content_type'];
                $contentMedia->media_id = $media['id'];
                if ($contentMedia->save(false)) {
                    //success
                    return true;
                } else {
                    return false;
                }
            }
        }

        return true;
    }
private function doMediaJoin ( $ result ) { if ( isset ( $ _GET [ 'content_id' ] ) && isset ( $ _GET [ 'content_type' ] ) ) { $ media = $ result [ 'data' ] ; if ( ! is_null ( $ media ) ) { //Do join here $ contentMedia = new ContentMedia ( ) ; $ contentMedia -> content_id = $ _GET [ 'content_id' ] ; $ contentMedia -> content_type = $ _GET [ 'content_type' ] ; $ contentMedia -> media_id = $ media [ 'id' ] ; if ( $ contentMedia -> save ( false ) ) { //success return true ; } else { return false ; } } } return true ; }
If content id and type provided then do join
return boolean
@param $result
@return bool
If content id and type provided then do join return boolean