public function available_updates() {

        if ($this->availableupdates === null) {
            // Lazy load the information about available updates.
            $this->availableupdates = $this->pluginman->load_available_updates_for_plugin($this->component);
        }

        if (empty($this->availableupdates) or !is_array($this->availableupdates)) {
            $this->availableupdates = array();
            return null;
        }

        $updates = array();

        foreach ($this->availableupdates as $availableupdate) {
            if ($availableupdate->version > $this->versiondisk) {
                $updates[] = $availableupdate;
            }
        }

        if (empty($updates)) {
            return null;
        }

        return $updates;
    }
public function available_updates() {

        if ($this->availableupdates === null) {
            // Lazy load the information about available updates.
            $this->availableupdates = $this->pluginman->load_available_updates_for_plugin($this->component);
        }

        if (empty($this->availableupdates) or !is_array($this->availableupdates)) {
            $this->availableupdates = array();
            return null;
        }

        $updates = array();

        foreach ($this->availableupdates as $availableupdate) {
            if ($availableupdate->version > $this->versiondisk) {
                $updates[] = $availableupdate;
            }
        }

        if (empty($updates)) {
            return null;
        }

        return $updates;
    }
public function available_updates ( ) { if ( $ this -> availableupdates === null ) { // Lazy load the information about available updates. $ this -> availableupdates = $ this -> pluginman -> load_available_updates_for_plugin ( $ this -> component ) ; } if ( empty ( $ this -> availableupdates ) or ! is_array ( $ this -> availableupdates ) ) { $ this -> availableupdates = array ( ) ; return null ; } $ updates = array ( ) ; foreach ( $ this -> availableupdates as $ availableupdate ) { if ( $ availableupdate -> version > $ this -> versiondisk ) { $ updates [ ] = $ availableupdate ; } } if ( empty ( $ updates ) ) { return null ; } return $ updates ; }
If there are updates for this plugin available, returns them.

Returns array of {@link \core\update\info} objects, if some update
is available. Returns null if there is no update available or if the update
availability is unknown.

Populates the property {@link $availableupdates} on first call (lazy
loading).

@return array|null
If there are updates for this plugin available returns them .