]> git.mxchange.org Git - friendica.git/blob - src/BaseObject.php
more usage of dbm::is_result() and sorted a bit statements
[friendica.git] / src / BaseObject.php
1 <?php
2 /**
3  * @file src/BaseObject.php
4  */
5 namespace Friendica;
6
7 require_once 'boot.php';
8
9 /**
10  * Basic object
11  *
12  * Contains what is useful to any object
13  */
14 class BaseObject
15 {
16         private static $app = null;
17
18         /**
19          * Get the app
20          *
21          * Same as get_app from boot.php
22          *
23          * @return App
24          */
25         public static function getApp()
26         {
27                 if (self::$app) {
28                         return self::$app;
29                 }
30
31                 self::$app = get_app();
32
33                 return self::$app;
34         }
35
36         /**
37          * Set the app
38          *
39          * @param object $app App
40          *
41          * @return void
42          */
43         public static function setApp($app)
44         {
45                 self::$app = $app;
46         }
47 }