/** * Get all table data using memory cache * @param array $columns * @return \Illuminate\Database\Eloquent\Collection|mixed|static[] */ public static function all($columns = ['*']) { $cacheName = 'activerecord.profilefield.all.' . implode('.', $columns); $records = MemoryObject::instance()->get($cacheName); if ($records === null) { $records = parent::all($columns); MemoryObject::instance()->set($cacheName, $records); } return $records; }
/** * Get all objects with query caching * @param $columns array * @return \Illuminate\Database\Eloquent\Collection * @throws SyntaxException */ public static function all($columns = ['*']) { $cacheName = 'activercord.app.all.' . implode('.', $columns); $records = MemoryObject::instance()->get($cacheName); if ($records === null) { $records = parent::all($columns); MemoryObject::instance()->set($cacheName, $records); } if ($records === null) { throw new SyntaxException('Applications is not found in table "prefix_apps"!'); } return $records; }
/** * Prepare static symbolic links for app services * @throws \InvalidArgumentException * @throws \Ffcms\Core\Exception\NativeException */ private function nativeStaticLinks() { // initialize memory and properties controllers self::$Memory = MemoryObject::instance(); self::$Properties = new Properties(); // initialize debugger if (isset($this->_services['Debug']) && $this->_services['Debug'] === true && Debug::isEnabled()) { self::$Debug = new Debug(); } // prepare request data self::$Request = Request::createFromGlobals(); // initialize response, securty translate and other workers self::$Security = new Security(); self::$Response = new Response(); self::$View = new View(); self::$Translate = new Translate(); self::$Alias = new Alias(); self::$Event = new EventManager(); self::$Cron = new CronManager(); }