Get add-on by ID (from local data).

@author Vova Feldman (@svovaf)
@since  1.0.6

@param number $id

@return FS_Plugin|false
427786
function get_addon( $id ) {
            $this->_logger->entrance();

            $addons = $this->get_addons();

            if ( is_array( $addons ) ) {
                foreach ( $addons as $addon ) {
                    if ( $id == $addon->id ) {
                        return $addon;
                    }
                }
            }

            return false;
        }
1107000
public function getById($id)
    {
        if ($this->id == $id) return $this;

        return $this->children->getById($id);
    }
465240
public function getPluginById($id)
    {
        foreach ($this->plugins as $plugin) {
            if ($plugin::getPluginId() == $id) {
                return $plugin;
            }
        }
    }
457070
protected function _getById($id) {
		$model = $this->_config['model'];
		return $model::find('first', ['conditions' => [$model::key() => $id]]);
	}
1131656
public function getById(int $id)
    {
        $result = $this->builder->getById($id);

        if (isset($result[0])) {
            return self::instance($result[0]);
        }

        return null;
    }
1197770
public function get($id)
    {
        $idName = ucfirst($this->idProperty->getName());
        return $this->__call("getBy$idName", array($id));
    }
1276395
public function get($id)
    {
        if (!$this->has($id)) {
            return;
        }

        return $this->container->findDefinition($id)->getClass();
    }
309188
static function get(string $id): ?\BearFramework\Addon
    {
        if (isset(self::$data[$id])) {
            return clone(self::$data[$id]);
        }
        return null;
    }
978840
public static function findById($id)
    {
        if (!$id || strlen($id) != 24) {
            return null;
        }
        $instance = static::entity()->get(get_called_class(), $id);
        if ($instance) {
            return $instance;
        }
        $mongo = static::entity()->getDatabase();
        $data = $mongo->findOne(static::$collection, ['_id' => $mongo->id($id)]);
        if (!$data) {
            return null;
        }
        $instance = new static;
        $data['__webiny_db__'] = true;
        $instance->populate($data);

        return static::entity()->add($instance);
    }
1055761
private function get($id) {
        if ($id === 0) {
            $this->response->setError();
            return false;
        }
        $entity = $this->entityManager->find(\Emeric0101\PHPAngular\Config::PHPANGULAR_BUNDLE ."\\Entity\\" . $this->name, $id);
        if ($entity === null) {
            $this->response->setError("NOT_FOUND");
            return false;
        }

        $this->response->setResponse($this->name, $entity);
        return true;
    }
1189723
private function includeFileForId($id)
	{
		$fileName = $this->getFilename($id);

		if (\file_exists($fileName)) {
			return include $fileName;
		}

		return null;
	}
1041619
public static function getByID($id)
    {
        if ($id) {
            $app = Application::getFacadeApplication();
            $em = $app->make(EntityManagerInterface::class);
            $result = $em->find(ThumbnailTypeEntity::class, $id);
        } else {
            $result = null;
        }

        return $result;
    }
818053
public static function get($id){
		$class_name = get_called_class();
		if( !isset(self::$instances[$class_name]) ){
			self::$instances[$class_name] = [];
		}
		if( !isset(self::$instances[$class_name][$id]) ){
			self::$instances[$class_name][$id] = new $class_name($id);
		}
		return self::$instances[$class_name][$id];
	}
809751
public function getLocaleById($id) {
        $locale = $this->source
            ->where('id', $id)
            ->first();

        return isset($locale->id) ? $locale->locale : null;
    }
663774
public function add(string $id): self
    {
        if (!isset($this->data[$id])) {
            $registeredAddon = \BearFramework\Addons::get($id);
            if ($registeredAddon === null) {
                throw new \Exception('The addon ' . $id . ' is not registered!');
            }
            $registeredAddonOptions = $registeredAddon->options;
            if (isset($registeredAddonOptions['require']) && is_array($registeredAddonOptions['require'])) {
                foreach ($registeredAddonOptions['require'] as $requiredAddonID) {
                    if (is_string($requiredAddonID) && !isset($this->data[$requiredAddonID])) {
                        $this->add($requiredAddonID);
                    }
                }
            }

            $dir = $registeredAddon->dir;
            $this->data[$id] = new \BearFramework\App\Addon($id, $dir);
            $this->app->contexts->add($dir);
        }
        return $this;
    }
946650
public static function find_by_id($id)
	{
		$hzad = self::oneOrNew($id);

		if (!$hzad->get('authenticator'))
		{
			return false;
		}

		return $hzad;
	}
905842
public function add($id)
    {
        if ($this->has($id)) {
            return $this->get($id);
        }

        $menu = $this->container->make(Menu::class, [
            'menuFactory' => $this
        ]);
        $this->runHook('menu-factory:add', [$this, $menu]);
        $this->menus->put($id, $menu);
        return $menu;
    }