/** * Create an object * * <code> * $userId = 1; * * $profile = Prism\Integration\Profile\EasyProfile::getInstance(\JFactory::getDbo(), $userId); * </code> * * @param \JDatabaseDriver $db * @param int $id * * @return self|null */ public static function getInstance(\JDatabaseDriver $db, $id) { if (!isset(self::$instances[$id])) { $item = new EasyProfile($db); $item->load($id); self::$instances[$id] = $item; } return self::$instances[$id]; }
/** * Create an object * * <code> * $userId = 1; * * $profile = Prism\Integration\Profile\EasyProfile::getInstance(\JFactory::getDbo(), $userId); * </code> * * @param \JDatabaseDriver $db * @param int $id * * @return self|null */ public static function getInstance(\JDatabaseDriver $db, $id) { if (!array_key_exists($id, self::$instances)) { $item = new EasyProfile($db); $item->load($id); self::$instances[$id] = $item; } return self::$instances[$id]; }