Plugin development Craft CMS 3 I am new to craft and I need help to understand how plugins work.
I am trying inject these functions to the CraftVariable 

{% for item in craft.plugin.exampleFunction(test).hide("noTitle") %}  


craft.plugin.exampleFunction(test) is working perfectly 
but .hide() is not. Can anybody tell me how to call this function?
Based on the discussion you'll need to implement a fetch function similar like Craft does it with the ElementCriteriaModel / ElementQuery. So you'll return some kind of search object until you execute the .find()/fetch() (or whatever you like to call it) function

class ClassName{

    /** @var array $_searchObjects */
    private $_searchObjects;

    /**
     * @param $something
     *
     * @return $this
     */
    public function exampleFunction($something){
        $this-&gt;_searchObjects = ['test', 'insert', 'your', 'array', 'here'];

        return $this;
    }

    /**
     * @param $string
     *
     * @return $this
     */
    public function hide($string){
        // filter your elements
        $this-&gt;_searchObjects = ...//

        return $this;
    }

    /**
     * @return array
     */
    public function find(){
        return $this-&gt;_searchObjects;
    }
}


You can then use it like

{% set elements = craft.plugin.exampleFunction.find() %}
{% set filterElements = craft.plugin.exampleFunction.hide('something').find() %}