public function add(array $data)
    {
        $result = null;
        $this->hook->attach('category.add.before', $data, $result, $this);

        if (isset($result)) {
            return (int) $result;
        }

        $result = $data['category_id'] = $this->db->insert('category', $data);

        $this->setTranslations($data, $this->translation_entity, 'category', false);
        $this->setImages($data, $this->file, 'category');
        $this->setAlias($data, $this->alias, 'category', false);

        $this->hook->attach('category.add.after', $data, $result, $this);
        return (int) $result;
    }
public function add(array $data)
    {
        $result = null;
        $this->hook->attach('category.add.before', $data, $result, $this);

        if (isset($result)) {
            return (int) $result;
        }

        $result = $data['category_id'] = $this->db->insert('category', $data);

        $this->setTranslations($data, $this->translation_entity, 'category', false);
        $this->setImages($data, $this->file, 'category');
        $this->setAlias($data, $this->alias, 'category', false);

        $this->hook->attach('category.add.after', $data, $result, $this);
        return (int) $result;
    }
public function add ( array $ data ) { $ result = null ; $ this -> hook -> attach ( 'category.add.before' , $ data , $ result , $ this ) ; if ( isset ( $ result ) ) { return ( int ) $ result ; } $ result = $ data [ 'category_id' ] = $ this -> db -> insert ( 'category' , $ data ) ; $ this -> setTranslations ( $ data , $ this -> translation_entity , 'category' , false ) ; $ this -> setImages ( $ data , $ this -> file , 'category' ) ; $ this -> setAlias ( $ data , $ this -> alias , 'category' , false ) ; $ this -> hook -> attach ( 'category.add.after' , $ data , $ result , $ this ) ; return ( int ) $ result ; }
Adds a category
@param array $data
@return integer
Adds a category