public function update($iId, $aData)
    {
        $aCategoryData = array();

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

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

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

        } else {

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

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

        $aCategoryData['slug'] = $this->generateSlug($aData['label'], $iId);

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

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

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

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

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

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

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

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

        return parent::update($iId, $aCategoryData);
    }
public function update($iId, $aData)
    {
        $aCategoryData = array();

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

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

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

        } else {

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

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

        $aCategoryData['slug'] = $this->generateSlug($aData['label'], $iId);

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

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

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

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

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

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

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

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

        return parent::update($iId, $aCategoryData);
    }
public function update ( $ iId , $ aData ) { $ aCategoryData = array ( ) ; // -------------------------------------------------------------------------- //  Some basic sanity testing if ( empty ( $ aData [ 'label' ] ) ) { $ this -> setError ( '"label" is a required field.' ) ; return false ; } else { $ aCategoryData [ 'label' ] = trim ( $ aData [ 'label' ] ) ; } // -------------------------------------------------------------------------- $ aCategoryData [ 'slug' ] = $ this -> generateSlug ( $ aData [ 'label' ] , $ iId ) ; if ( isset ( $ aData [ 'description' ] ) ) { $ aCategoryData [ 'description' ] = $ aData [ 'description' ] ; } if ( isset ( $ aData [ 'seo_title' ] ) ) { $ aCategoryData [ 'seo_title' ] = strip_tags ( $ aData [ 'seo_title' ] ) ; } if ( isset ( $ aData [ 'seo_description' ] ) ) { $ aCategoryData [ 'seo_description' ] = strip_tags ( $ aData [ 'seo_description' ] ) ; } if ( isset ( $ aData [ 'seo_keywords' ] ) ) { $ aCategoryData [ 'seo_keywords' ] = strip_tags ( $ aData [ 'seo_keywords' ] ) ; } return parent :: update ( $ iId , $ aCategoryData ) ; }
Updates an existing category
@param  integer $iId   The category's ID
@param  array   $aData The data to update the category with
@return boolean
Updates an existing category