Returns version information for package

@param $id

@return array
183254
protected function getPackageVersions($id)
    {
        $localPackage  = $this->get('package.repository')->findOneById($id);
        $remotePackage = $this->get('package.helper')->getPackage($localPackage->getFullName());
        $versions      = $remotePackage->getVersions();
        $result        = [];
        
        foreach ($versions as $version) {
            $this->getPackageInfo($version, $result);
        }
        
        return $result;
    }
128882
public function getVersions()
    {
        $this->createIfNotExists();
        $sql = 'SELECT version FROM schema_migration ORDER BY version DESC';
        $versions = array();
        foreach ($this->connection->query($sql) as $row) {
            $versions[] = $row['version'];
        }

        return $versions;
    }
145868
public function getUpdate($id)
    {
        return $this->send($this->getHttp()->get($this->url.'updates/'.$id.'.json'));
    }
21126
public function pingHook(int $id): array
    {
        return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/hooks/:id/pings',
            $this->getRepositories()->getOwner(), $this->getRepositories()->getRepo(), $id), Request::METHOD_POST);
    }
1074499
public function getItemById($id)
    {
        $items = $this->getItems();
        if (isset($items[$id])) {
            return $items[$id];
        }

        return null;
    }
1173465
protected function getPackageInfo(Version $version, &$result)
    {
        $date           = new \DateTime($version->getTime());
        $packageVersion = $version->getVersion();
        if ($packageVersion === PackageHelperInterface::DEFAULT_BRANCH_VERSION) {
            $result[$packageVersion] = [
                'version'     => $packageVersion,
                'date'        => $date->format('Y-m-d H:i:s'),
                'authors'     => $version->getAuthors(),
                'description' => $version->getDescription(),
                'homepage'    => $version->getHomepage(),
                'license'     => $version->getLicense(),
            ];
        }
    }
856973
public function get($id)
    {
        return $this->getByPath(sprintf('/%s/%s/%s', MoipResource::VERSION, self::PATH, $id));
    }
1160667
protected function doContains($id)
    {

        $md5Key = md5($id);

        $kvm = KVMLogger::instance('anycontent-cache');

        $hit = $this->getCacheProvider()->doContains($md5Key);

        if ($hit)
        {
            $this->hit++;
            $message = $kvm->createLogMessage('Cache hit', [ 'key' => $id, 'md5' => $md5Key, 'namespace' => $this->getNamespace() ]);
            $kvm->debug($message);
        }
        else
        {
            $this->miss++;
            $message = $kvm->createLogMessage('Cache miss', [ 'key' => $id, 'namespace' => $this->getNamespace() ]);
            $kvm->debug($message);
        }

        return $hit;
    }
1333159
public function getRecipeById($id)
    {
        $result = [
            'className' => (isset($this->classNameById[$id])) ?
                $this->classNameById[$id] :
                null,
            'arguments' => (isset($this->argumentsById[$id])) ?
                $this->argumentsById[$id] :
                null,
            'constructor' => (isset($this->constructorById[$id])) ?
                $this->constructorById[$id] :
                null,
            'dependencies' => (isset($this->dependenciesById[$id])) ?
                $this->dependenciesById[$id] :
                null,
        ];

        return $result;
    }
1143089
public function read( $id )
	{
	    if ( $this->has( $id ) )
		{
			return \CCJson::read( $this->file_path( $id ) );
		}
		
		return array();
	}
1204762
public function getValues(string $id): array
    {
        $data = Internal\Data::getValue('bearcms/themes/theme/' . md5($id) . '.json');
        if ($data !== null) {
            $data = json_decode($data, true);
            if (isset($data['options'])) {
                return $data['options'];
            }
        }
        return [];
    }
163185
private function version($package)
    {
        $list      = $this->gpm->{'getUpdatable' . ucfirst($package->package_type)}();
        $package   = $list[$package->slug] ?? $package;
        $type      = ucfirst(preg_replace('/s$/', '', $package->package_type));
        $updatable = $this->gpm->{'is' . $type . 'Updatable'}($package->slug);
        $installed = $this->gpm->{'is' . $type . 'Installed'}($package->slug);
        $local     = $this->gpm->{'getInstalled' . $type}($package->slug);

        if (!$installed || !$updatable) {
            $version   = $installed ? $local->version : $package->version;
            return "v<green>{$version}</green>";
        }

        if ($updatable) {
            return "v<red>{$package->version}</red> <cyan>-></cyan> v<green>{$package->available}</green>";
        }

        return '';
    }
668735
public static function get( $id ) {
		if ( file_exists( Utils\get_snapshot_directory() . $id . '/meta.json' ) ) {
			$meta_file_contents = file_get_contents( Utils\get_snapshot_directory() . $id . '/meta.json' );
			$meta               = json_decode( $meta_file_contents, true );
		} else {
			$meta = [];
		}

		/**
		 * Backwards compant - need to fill in repo before we started saving repo in meta.
		 */
		if ( empty( $meta['repository'] ) ) {
			Log::instance()->write( 'Legacy snapshot found without repository. Assuming default repository.', 1, 'warning' );

			$meta['repository'] = RepositoryManager::instance()->getDefault();
		}

		return new self( $id, $meta['repository'], $meta );
	}
221381
public function getVersionModel($version_id)
    {
        $version = $this->versions()->where("version_id", "=", $version_id)->first();
        if (!is_null($version)) {
            return $version->getModel();
        }
        return null;
    }
753293
public function getDealerAdminVersions()
    {
        if (null === $this->dealer_admin_versions_unserialized) {
            $this->dealer_admin_versions_unserialized = array();
        }
        if (!$this->dealer_admin_versions_unserialized && null !== $this->dealer_admin_versions) {
            $dealer_admin_versions_unserialized = substr($this->dealer_admin_versions, 2, -2);
            $this->dealer_admin_versions_unserialized = $dealer_admin_versions_unserialized ? explode(' | ', $dealer_admin_versions_unserialized) : array();
        }

        return $this->dealer_admin_versions_unserialized;
    }
588738
private function getPackageVersionSubscriptions(PackageEntity $package)
    {
        $result = [];
        $me = $this->getAccessHelper()->getUserEntity('current');
        $repo = $this->app->make(PackageVersionSubscriptionRepository::class);
        /* @var PackageVersionSubscriptionRepository $repo */
        $pvsList = $repo->createQueryBuilder('s')
            ->innerJoin(PackageVersionEntity::class, 'pv', 'WITH', 's.packageVersion = pv.id')
            ->where('s.user = :user')->setParameter('user', $me)
            ->andWhere('pv.package = :package')->setParameter('package', $package)
            ->getQuery()
                ->execute();
        foreach ($package->getSortedVersions(true) as $packageVersion) {
            $pvs = null;
            foreach ($pvsList as $existing) {
                if ($existing->getPackageVersion() === $packageVersion) {
                    $pvs = $existing;
                    break;
                }
            }
            if ($pvs === null) {
                $pvs = PackageVersionSubscriptionEntity::create($me, $packageVersion, false);
            }
            $result[] = $pvs;
        }

        return $result;
    }
1176668
public function getAllVersions()
    {
        $versions = array();

        foreach ($this->getEntities() as $entity) {
            if ($entity->getVersion()) {
                $versions[$entity->getVersion()] = $entity->getVersion();
            } else {
                $versions['0.0'] = _t('DocumentationManifest.MASTER', 'Master');
            }
        }

        asort($versions);

        return $versions;
    }