6 * Base module for all modules
8 * @author Sebastian Skejø
14 private $_core = null;
15 private $_toModel = null;
18 * Default constructor. Redefined constructors must take $core as first argument and call $this->_init($core)
19 * @param AOOSCore $core A reference to the core object
20 * @param bool $toModel If this is set to 'true' module must implement the public function: AOOSModel toModel();
22 public function __construct(&$core, $toModel = false)
24 $this->_init($core, $toModel);
28 * Must be called when redefining constructor. Takes core object as first argument.
29 * @param AOOSCore $core A reference to the core object
31 private function _init($core, $toModel)
33 if (!$core instanceof AOOSCore ||
!isset($core))
38 if (!is_bool($toModel))
45 $this->core()->log(__class__
." instantiated");
46 // $this->_toModel = $_toModel;
50 * Translates a given string to language selected in settings
51 * @param string $stringID The unique ID of the string to translate
53 public function tr($stringID)
58 $string = $this->core()->getTranslatedString($stringID);
60 catch (AOOSException
$e)
67 * Returns the current core
70 public function core()