public function create($aData, $bReturnObject = false)
    {
        $aTagData = array();

        // --------------------------------------------------------------------------

        //  Some basic sanity testing
        if (empty($aData['label'])) {

            $this->setError('"label" is a required field.');
            return false;

        } else {

            $aTagData['label'] = trim($aData['label']);
        }

        if (empty($aData['blog_id'])) {

            $this->setError('"blog_id" is a required field.');
            return false;

        } else {

            $aTagData['blog_id'] = $aData['blog_id'];
        }

        // --------------------------------------------------------------------------

        $aTagData['slug'] = $this->generateSlug($aData['label']);

        if (isset($aData['description'])) {

            $aTagData['description'] = $aData['description'];
        }

        if (isset($aData['seo_title'])) {

            $aTagData['seo_title'] = strip_tags($aData['seo_title']);
        }

        if (isset($aData['seo_description'])) {

            $aTagData['seo_description'] = strip_tags($aData['seo_description']);
        }

        if (isset($aData['seo_keywords'])) {

            $aTagData['seo_keywords'] = strip_tags($aData['seo_keywords']);
        }

        return parent::create($aTagData, $bReturnObject);
    }
public function create($aData, $bReturnObject = false)
    {
        $aTagData = array();

        // --------------------------------------------------------------------------

        //  Some basic sanity testing
        if (empty($aData['label'])) {

            $this->setError('"label" is a required field.');
            return false;

        } else {

            $aTagData['label'] = trim($aData['label']);
        }

        if (empty($aData['blog_id'])) {

            $this->setError('"blog_id" is a required field.');
            return false;

        } else {

            $aTagData['blog_id'] = $aData['blog_id'];
        }

        // --------------------------------------------------------------------------

        $aTagData['slug'] = $this->generateSlug($aData['label']);

        if (isset($aData['description'])) {

            $aTagData['description'] = $aData['description'];
        }

        if (isset($aData['seo_title'])) {

            $aTagData['seo_title'] = strip_tags($aData['seo_title']);
        }

        if (isset($aData['seo_description'])) {

            $aTagData['seo_description'] = strip_tags($aData['seo_description']);
        }

        if (isset($aData['seo_keywords'])) {

            $aTagData['seo_keywords'] = strip_tags($aData['seo_keywords']);
        }

        return parent::create($aTagData, $bReturnObject);
    }
public function create ( $ aData , $ bReturnObject = false ) { $ aTagData = array ( ) ; // -------------------------------------------------------------------------- //  Some basic sanity testing if ( empty ( $ aData [ 'label' ] ) ) { $ this -> setError ( '"label" is a required field.' ) ; return false ; } else { $ aTagData [ 'label' ] = trim ( $ aData [ 'label' ] ) ; } if ( empty ( $ aData [ 'blog_id' ] ) ) { $ this -> setError ( '"blog_id" is a required field.' ) ; return false ; } else { $ aTagData [ 'blog_id' ] = $ aData [ 'blog_id' ] ; } // -------------------------------------------------------------------------- $ aTagData [ 'slug' ] = $ this -> generateSlug ( $ aData [ 'label' ] ) ; if ( isset ( $ aData [ 'description' ] ) ) { $ aTagData [ 'description' ] = $ aData [ 'description' ] ; } if ( isset ( $ aData [ 'seo_title' ] ) ) { $ aTagData [ 'seo_title' ] = strip_tags ( $ aData [ 'seo_title' ] ) ; } if ( isset ( $ aData [ 'seo_description' ] ) ) { $ aTagData [ 'seo_description' ] = strip_tags ( $ aData [ 'seo_description' ] ) ; } if ( isset ( $ aData [ 'seo_keywords' ] ) ) { $ aTagData [ 'seo_keywords' ] = strip_tags ( $ aData [ 'seo_keywords' ] ) ; } return parent :: create ( $ aTagData , $ bReturnObject ) ; }
Creates a new tag
@param  array   $aData         The data to create the tag with
@param  boolean $bReturnObject Whether to return the full tag object (or just the ID)
@return mixed
Creates a new tag