classes/Collections/Elements.php
protected function assocAdminChoices()
    {
        // Build the query
        $query = call_user_func([$this->model, 'query']);
        if ($this->locale) {
            $query->localize($this->locale);
        }

        // Convert models to simple array
        $elements = array_map(function (Element $element) {

            // Don't need the key as an attribute because of the dictionary conversion
            $ar = array_except($element->toArray(), ['key']);

            // Restore relationships
            $ar['images'] = $element->images;

            return $ar;

        // .. from a dictionary of ALL elements for the locale
        }, $query->get()->getDictionary());

        // Store the keys of all these elements so we can keep track of which
        // Elements "exist"
        $this->updated_items = array_keys($elements);

        // Return the elements
        return $elements;
    }
protected function assocAdminChoices()
    {
        // Build the query
        $query = call_user_func([$this->model, 'query']);
        if ($this->locale) {
            $query->localize($this->locale);
        }

        // Convert models to simple array
        $elements = array_map(function (Element $element) {

            // Don't need the key as an attribute because of the dictionary conversion
            $ar = array_except($element->toArray(), ['key']);

            // Restore relationships
            $ar['images'] = $element->images;

            return $ar;

        // .. from a dictionary of ALL elements for the locale
        }, $query->get()->getDictionary());

        // Store the keys of all these elements so we can keep track of which
        // Elements "exist"
        $this->updated_items = array_keys($elements);

        // Return the elements
        return $elements;
    }
protected function assocAdminChoices ( ) { // Build the query $ query = call_user_func ( [ $ this -> model , 'query' ] ) ; if ( $ this -> locale ) { $ query -> localize ( $ this -> locale ) ; } // Convert models to simple array $ elements = array_map ( function ( Element $ element ) { // Don't need the key as an attribute because of the dictionary conversion $ ar = array_except ( $ element -> toArray ( ) , [ 'key' ] ) ; // Restore relationships $ ar [ 'images' ] = $ element -> images ; return $ ar ; // .. from a dictionary of ALL elements for the locale } , $ query -> get ( ) -> getDictionary ( ) ) ; // Store the keys of all these elements so we can keep track of which // Elements "exist" $ this -> updated_items = array_keys ( $ elements ) ; // Return the elements return $ elements ; }
Get admin overrides to Elements from the databse

@return array
Get admin overrides to Elements from the databse