@param string $id
@param string $secondary_id
@param bool   $network_level_or_blog_id

@return FS_Key_Value_Storage
432499
static function instance( $id, $secondary_id, $network_level_or_blog_id = false ) {
            $key = $id . ':' . $secondary_id;

            if ( is_multisite() ) {
                if ( true === $network_level_or_blog_id ) {
                    $key .= ':ms';
                } else if ( is_numeric( $network_level_or_blog_id ) && $network_level_or_blog_id > 0 ) {
                    $key .= ":{$network_level_or_blog_id}";
                } else {
                    $network_level_or_blog_id = get_current_blog_id();

                    $key .= ":{$network_level_or_blog_id}";
                }
            }

			if ( ! isset( self::$_instances[ $key ] ) ) {
				self::$_instances[ $key ] = new FS_Key_Value_Storage( $id, $secondary_id, $network_level_or_blog_id );
			}

			return self::$_instances[ $key ];
		}
960746
private function getSharedItemKey(int $id): int
    {
        if ($id <= 0) {
            throw new \InvalidArgumentException('ID cannot be less or equals zero');
        }

        $st = @stat(__FILE__);
        if (!$st) {
            return -1;
        }

        //@TODO collisions? need more unique key
        $key = (int)sprintf("%u",
            (
                ($st['ino'] & 0xffff) |
                (($st['dev'] & 0xff) << 16) |
                (($id & 0xff) << 24)
            )
        );

        return $key;
    }
239454
protected static function &register_store_id($id) {
        if (is_null(self::$sessionstore)) {
            global $SESSION;
            if (!isset($SESSION->cachestore_session)) {
                $SESSION->cachestore_session = array();
            }
            self::$sessionstore =& $SESSION->cachestore_session;
        }
        if (!array_key_exists($id, self::$sessionstore)) {
            self::$sessionstore[$id] = array();
        }
        return self::$sessionstore[$id];
    }
555753
public function getRecord($id) {
		if(is_numeric($id)) {
			return parent::getRecord($id);
		} else {
			return ExternalContent::getDataObjectFor($id);
		}
	}
1301865
function get_network_install_blog_id() {
            if ( ! $this->_is_network_active ) {
                return null;
            }

            return FS_Site::is_valid_id( $this->_storage->network_install_blog_id ) ?
                $this->_storage->network_install_blog_id :
                null;
        }
644443
static function get_manager( $id, $load = false, $network_level_or_blog_id = false ) {
            $key = strtolower( $id );

            if ( is_multisite() ) {
                if ( true === $network_level_or_blog_id ) {
                    $key .= ':ms';
                } else if ( is_numeric( $network_level_or_blog_id ) && $network_level_or_blog_id > 0 ) {
                    $key .= ":{$network_level_or_blog_id}";
                } else {
                    $network_level_or_blog_id = get_current_blog_id();

                    $key .= ":{$network_level_or_blog_id}";
                }
            }

            if ( ! isset( self::$_MANAGERS[ $key ] ) ) {
                self::$_MANAGERS[ $key ] = new FS_Option_Manager( $id, $load, $network_level_or_blog_id );
            } // If load required but not yet loaded, load.
            else if ( $load && ! self::$_MANAGERS[ $key ]->is_loaded() ) {
                self::$_MANAGERS[ $key ]->load();
            }

            return self::$_MANAGERS[ $key ];
        }
431075
function set_recorder_externalid($id, $externalid) {
        if ($externalid === 'NULL') {
            $externalid = null;
        }
        try {
            $param = new \Panopto\RemoteRecorderManagement\UpdateRemoteRecorderExternalId($this->auth, $id, $externalid);
            $result = $this->rrmclient->UpdateRemoteRecorderExternalId($param);
        } catch (Exception $e) {
            throw new SoapFault('client', $e->getMessage());
        }
        return $result;
    }
512764
public function getById($id, $cascade = false) {
        $result = self::getField($this->data, $id, null);
        if ($cascade && null !== $result && isset($this->one[$id])) {
            foreach ($this->one[$id] as $class => $foreignId) {
                $result = array_merge($class::getInstance()->getById($foreignId, $cascade), $result);
            }
        }
        return $result;
    }
894733
public static function id2dir($id = null) {
        if ($id === null) {
            return self::$maps ['id2dir'];
        }
        if (isset (self::$maps ['id2dir'] [ $id ])) {
            return self::$maps ['id2dir'] [ $id ];
        } else {
            return $id;
        }
    }
498863
public function selectedNodeId($id=null){
        
        if(is_integer($id)){
          $this->selectedid =$id;    
          $this->selectednodeid =$id;    
        }
        return $this->selectedid;
        
    }
246904
public function get($id_or_external_id) {
    $key = is_int($id_or_external_id) ? 'id' : 'external_id';
    foreach ($this as $item) {
      if ($item->{$key} === $id_or_external_id) {
        return $item;
      }
    }
    return null;
  }
1329776
protected function writeToBigStorageIfNeeded($id, &$value)
    {
        if (!$this->bigStorage) {
            return false;
        }

        if (is_string($value) && strlen($value) <= $this->maxMainStorageBytes) {
            return false;
        }

        try {
            $this->bigStorage[$id] = $value;
            return true;
        } catch (\Exception $e) {
            $msg = "Data of id #$id (type:" . Type::of($value) . ") couldnt be written to big storage";
            $e = new DataIntegrityException($msg, 0, $e);
            $this->callOnListeners('error', [$e]);
        }

        return false;

    }
1212825
protected function _getNode($id)
    {
        $config = $this->getConfig();
        list($parent, $left, $right) = [$config['parent'], $config['left'], $config['right']];
        $primaryKey = $this->_getPrimaryKey();
        $fields = [$parent, $left, $right];
        if ($config['level']) {
            $fields[] = $config['level'];
        }

        $node = $this->_scope($this->_table->find())
            ->select($fields)
            ->where([$this->_table->aliasField($primaryKey) => $id])
            ->first();

        if (!$node) {
            throw new RecordNotFoundException("Node \"{$id}\" was not found in the tree.");
        }

        return $node;
    }
584184
function get_install_by_blog_id( $blog_id = null ) {
            $installs = self::get_all_sites( $this->_module_type, $blog_id );
            $install  = isset( $installs[ $this->_slug ] ) ? $installs[ $this->_slug ] : null;

            if ( is_object( $install ) &&
                 is_numeric( $install->id ) &&
                 is_numeric( $install->user_id ) &&
                 FS_Plugin_Plan::is_valid_id( $install->plan_id )
            ) {
                // Load site.
                $install = clone $install;
            }

            return $install;
        }
314538
private function load($id = null)
    {

        $this->initialize();
        $this->id = $id;
        $dataConnector = $this->getDataConnector();
        if (!is_null($dataConnector)) {
            return $dataConnector->loadUser($this);
        }

        return false;
    }
465994
public function characterWalletJournalInteractions(int $first_party_id, int $second_party_id) : Builder
    {

        return CharacterWalletJournal::with('first_party', 'second_party')
            ->where('first_party_id', '=', $first_party_id)
            ->where('second_party_id', '=', $second_party_id);

    }
335141
public function savePropertyId($propertyId, $id = false)
    {
        $em = $this->getEntityManager();
        $config = $id ? $this->find($id) : $this->findFirst();
        $config->setPropertyId($propertyId);
        $em->persist($config);
        $em->flush();
    }