protected function getTaxonomy($content)
    {
        $tablename = $this->getTablename("taxonomy");

        $ids = Arr::column($content, 'id');

        if (empty($ids)) {
            return;
        }

        // Get the contenttype from first $content
        $first = reset($content);
        $config = $first->contenttype;
        $contenttype = (isset($config['key'])) ? $config['key'] : $config['slug'];

        $taxonomytypes = $this->app['config']->get('taxonomy');

        // If there are no taxonomytypes, there won't be any results, so we return.
        if (empty($taxonomytypes)) {
            return;
        }

        $query = sprintf(
            "SELECT * FROM %s WHERE content_id IN (?) AND contenttype=? AND taxonomytype IN (?)",
            $tablename
        );
        $rows = $this->app['db']->executeQuery(
            $query,
            [$ids, $contenttype, array_keys($taxonomytypes)],
            [DoctrineConn::PARAM_INT_ARRAY, \PDO::PARAM_STR, DoctrineConn::PARAM_STR_ARRAY]
        )->fetchAll();

        foreach ($rows as $row) {
            $content[$row['content_id']]->setTaxonomy($row['taxonomytype'], $row['slug'], $row['name'], $row['sortorder']);
        }

        foreach ($content as $key => $value) {
            $content[$key]->sortTaxonomy();
        }
    }
protected function getTaxonomy($content)
    {
        $tablename = $this->getTablename("taxonomy");

        $ids = Arr::column($content, 'id');

        if (empty($ids)) {
            return;
        }

        // Get the contenttype from first $content
        $first = reset($content);
        $config = $first->contenttype;
        $contenttype = (isset($config['key'])) ? $config['key'] : $config['slug'];

        $taxonomytypes = $this->app['config']->get('taxonomy');

        // If there are no taxonomytypes, there won't be any results, so we return.
        if (empty($taxonomytypes)) {
            return;
        }

        $query = sprintf(
            "SELECT * FROM %s WHERE content_id IN (?) AND contenttype=? AND taxonomytype IN (?)",
            $tablename
        );
        $rows = $this->app['db']->executeQuery(
            $query,
            [$ids, $contenttype, array_keys($taxonomytypes)],
            [DoctrineConn::PARAM_INT_ARRAY, \PDO::PARAM_STR, DoctrineConn::PARAM_STR_ARRAY]
        )->fetchAll();

        foreach ($rows as $row) {
            $content[$row['content_id']]->setTaxonomy($row['taxonomytype'], $row['slug'], $row['name'], $row['sortorder']);
        }

        foreach ($content as $key => $value) {
            $content[$key]->sortTaxonomy();
        }
    }
protected function getTaxonomy ( $ content ) { $ tablename = $ this -> getTablename ( "taxonomy" ) ; $ ids = Arr :: column ( $ content , 'id' ) ; if ( empty ( $ ids ) ) { return ; } // Get the contenttype from first $content $ first = reset ( $ content ) ; $ config = $ first -> contenttype ; $ contenttype = ( isset ( $ config [ 'key' ] ) ) ? $ config [ 'key' ] : $ config [ 'slug' ] ; $ taxonomytypes = $ this -> app [ 'config' ] -> get ( 'taxonomy' ) ; // If there are no taxonomytypes, there won't be any results, so we return. if ( empty ( $ taxonomytypes ) ) { return ; } $ query = sprintf ( "SELECT * FROM %s WHERE content_id IN (?) AND contenttype=? AND taxonomytype IN (?)" , $ tablename ) ; $ rows = $ this -> app [ 'db' ] -> executeQuery ( $ query , [ $ ids , $ contenttype , array_keys ( $ taxonomytypes ) ] , [ DoctrineConn :: PARAM_INT_ARRAY , \ PDO :: PARAM_STR , DoctrineConn :: PARAM_STR_ARRAY ] ) -> fetchAll ( ) ; foreach ( $ rows as $ row ) { $ content [ $ row [ 'content_id' ] ] -> setTaxonomy ( $ row [ 'taxonomytype' ] , $ row [ 'slug' ] , $ row [ 'name' ] , $ row [ 'sortorder' ] ) ; } foreach ( $ content as $ key => $ value ) { $ content [ $ key ] -> sortTaxonomy ( ) ; } }
Get the taxonomy for one or more units of content, return the array with the taxonomy attached.

@param \Bolt\Legacy\Content[] $content

@return array $content
Get the taxonomy for one or more units of content return the array with the taxonomy attached .