public function getCollectionItemAjax()
    {
        $term = $this->getPosted('term');
        $collection_id = $this->getPosted('collection_id');

        if (empty($term) || empty($collection_id)) {
            return array('error' => $this->text('An error occurred'));
        }

        $collection = $this->collection->get($collection_id);

        if (empty($collection)) {
            return array('error' => $this->text('An error occurred'));
        }

        if (!$this->access($collection['type'])) {
            return array('error' => $this->text('No access'));
        }

        $conditions = array(
            'status' => 1,
            'title' => $term,
            'store_id' => $collection['store_id'],
            'limit' => array(0, $this->config('autocomplete_limit', 10))
        );

        return $this->collection_item->getListEntities($collection['type'], $conditions);
    }
public function getCollectionItemAjax()
    {
        $term = $this->getPosted('term');
        $collection_id = $this->getPosted('collection_id');

        if (empty($term) || empty($collection_id)) {
            return array('error' => $this->text('An error occurred'));
        }

        $collection = $this->collection->get($collection_id);

        if (empty($collection)) {
            return array('error' => $this->text('An error occurred'));
        }

        if (!$this->access($collection['type'])) {
            return array('error' => $this->text('No access'));
        }

        $conditions = array(
            'status' => 1,
            'title' => $term,
            'store_id' => $collection['store_id'],
            'limit' => array(0, $this->config('autocomplete_limit', 10))
        );

        return $this->collection_item->getListEntities($collection['type'], $conditions);
    }
public function getCollectionItemAjax ( ) { $ term = $ this -> getPosted ( 'term' ) ; $ collection_id = $ this -> getPosted ( 'collection_id' ) ; if ( empty ( $ term ) || empty ( $ collection_id ) ) { return array ( 'error' => $ this -> text ( 'An error occurred' ) ) ; } $ collection = $ this -> collection -> get ( $ collection_id ) ; if ( empty ( $ collection ) ) { return array ( 'error' => $ this -> text ( 'An error occurred' ) ) ; } if ( ! $ this -> access ( $ collection [ 'type' ] ) ) { return array ( 'error' => $ this -> text ( 'No access' ) ) ; } $ conditions = array ( 'status' => 1 , 'title' => $ term , 'store_id' => $ collection [ 'store_id' ] , 'limit' => array ( 0 , $ this -> config ( 'autocomplete_limit' , 10 ) ) ) ; return $ this -> collection_item -> getListEntities ( $ collection [ 'type' ] , $ conditions ) ; }
Returns an array of suggested collection entities
@return array
Returns an array of suggested collection entities