Get sites.
@api
@param array|bool $blog_ids
@return array
552184
public static function get_sites( $blog_ids = false ) {
		if ( !is_array($blog_ids) ) {
			global $wpdb;
			$blog_ids = $wpdb->get_col("SELECT blog_id FROM $wpdb->blogs ORDER BY blog_id ASC");
		}
		$return = array();
		foreach ( $blog_ids as $blog_id ) {
			$return[] = new Site($blog_id);
		}
		return $return;
	}
784461
public function getByIds(array $ids, $orderStrict = false)
    {
        $nodes = $this->om->findByIds(
            'Claroline\CoreBundle\Entity\Resource\ResourceNode',
            $ids,
            $orderStrict
        );

        return $nodes;
    }
275350
public function getRedirectEntityList($siteId)
    {
        try {
            $result = $this->getRedirectQuery($siteId)->getResult();
        } catch (NoResultException $e) {
            $result = [];
        }

        return $result;
    }
146743
public function getBlogPosts()
    {
        $blog_posts = BlogPost::get()
            ->filter('ParentID', $this->ID)
            ->where(sprintf('"PublishDate" < \'%s\'', Convert::raw2sql(DBDatetime::now())));

        $this->extend('updateGetBlogPosts', $blog_posts);
        return $blog_posts;
    }
595837
public function many( array $ids = [] ) {
        if( count( $ids ) === 0 ) {
            return [];
        }

        $pages = array_chunk( $ids, $this->maxPageSize() );

        $requests = [];
        foreach( $pages as $page ) {
            $requests[] = [ 'ids' => implode( ',', $page ) ];
        }

        $responses = $this->requestMany( $requests );

        $result = [];
        foreach( $responses as $response ) {
            $result = array_merge( $result, $response->json() );
        }

        return $result;
    }
102101
public function getUserRoles($user_id)
    {
        $roles = array();

        foreach ((array) get_sites() as $site) {

            //Get user role
            if ($site->blog_id != 1) {
                $userSettings = get_user_meta($user_id, $this->db->prefix . $site->blog_id . '_capabilities', true);
            } else {
                $userSettings = get_user_meta($user_id, $this->db->prefix . 'capabilities', true);
            }

            //Store to settings array
            if (is_array($userSettings)) {
                $roles[$site->blog_id] = key($userSettings);
            } else {
                $roles[$site->blog_id] = false;
            }
        }

        return $roles;
    }
627700
private function get_site( $site_id ) {
		global $wpdb;

		// Load site data
		$site = $wpdb->get_row(
			$wpdb->prepare(
				"SELECT * FROM {$wpdb->blogs} WHERE blog_id = %d",
				$site_id
			)
		);

		if ( ! empty( $site ) ) {
			// Only care about domain and path which are set here
			return $site;
		}

		return false;
	}
102324
public function getLists($ids = null, $args = array(), $returnRaw = false)
    {
        if ($ids) {
            $args['id'] = $ids;
        }

        return $this->getResult('getLists', $args, is_array($ids), $returnRaw);
    }
719778
protected function getSiteId($sites, $site_name)
    {
        if ($site = $this->getSiteByName($sites, $site_name)) {
            return $site->id;
        }
        return null;
    }
842089
public function get( array $args = [], array $assoc_args = [] ) {

		$site_id = (int) $args[ 0 ];
		$site    = get_blog_details( $site_id );
		if ( ! $site ) {
			WP_CLI::error( "A site with ID {$site_id} does not exist" );
		}

		// trailing-slash it, as URLs ends always with a trailing slash in context of the wp_blogs table
		WP_CLI::line( trailingslashit( $site->siteurl ) );
		exit( 0 );
	}
803227
public function getAllSites()
    {
        Piwik::checkUserHasSuperUserAccess();

        $sites  = $this->getModel()->getAllSites();
        $return = array();
        foreach ($sites as $site) {
            $this->enrichSite($site);
            $return[$site['idsite']] = $site;
        }

        $return = Site::setSitesFromArray($return);

        return $return;
    }
519961
private static function get_active_plugins( $blog_id = 0 ) {
            self::require_plugin_essentials();

            $active_plugin            = array();
            $all_plugins              = fs_get_plugins();
            $active_plugins_basenames = self::get_active_plugins_basenames( $blog_id );

            foreach ( $active_plugins_basenames as $plugin_basename ) {
                $active_plugin[ $plugin_basename ] = $all_plugins[ $plugin_basename ];
            }

            return $active_plugin;
        }
801593
private function get_site_options( $blog_id = 0 ) {
            if ( 0 == $blog_id || $blog_id == $this->_blog_id ) {
                return $this->_options;
            }

            return FS_Option_Manager::get_manager( $this->_id, true, $blog_id );
        }
103824
private function _getPage($ids)
    {
        $object = $this->_pager['object'];
        $method = $this->_pager['method'];
        $methodArgs = [];
        foreach ($this->_pager['methodArgs'] as $arg) {
            array_push($methodArgs, $arg);
        }
        array_push($methodArgs, $ids);

        return call_user_func_array(
            [$object, $method],
            $methodArgs
        );
    }
150180
public function getList()
    {
        $sites = $this->siteManager->findAll();
        $this->addPaginationData($sites);
        $sites = $sites->getItems();
        if (empty($sites)) {
            $this->addInfoMessage(self::INFO_NO_ENTRIES_FOUND);
        }
        return $sites;
    }
35328
public function getSite(int $id): Site
    {
        $path = sprintf('sites/%d', $id);

        $response = $this->getClient()->sendRequest('GET', $path);

        /** @var Site $model */
        $model = $this->getModelFactory()->create(Site::class, $response);

        return $model;
    }
500697
public function getAllSitesIdFromSiteUrl(array $urls)
    {
        $siteUrlTable = Common::prefixTable('site_url');

        $db = $this->getDb();
        $ids = $db->fetchAll(
            'SELECT idsite FROM ' . $this->table . '
                    WHERE main_url IN ( ' . Common::getSqlStringFieldsArray($urls) . ') ' .
            'UNION
                SELECT idsite FROM ' . $siteUrlTable . '
                    WHERE url IN ( ' . Common::getSqlStringFieldsArray($urls) . ') ',

            // Bind
            array_merge( $urls, $urls)
        );

        return $ids;
    }