From 7440840f53402e36535a43f6a8c0902a0008286e Mon Sep 17 00:00:00 2001 From: Laurent Opprecht Date: Tue, 10 Apr 2012 08:55:30 +0200 Subject: [PATCH] shibboleth authentication module #4554, add new templates for code generation --- .../app/lib/scaffolder/template/default.php | 145 ++++++++++++++++++ .../app/lib/scaffolder/template/public.php | 38 +++++ 2 files changed, 183 insertions(+) create mode 100644 main/auth/shibboleth/app/lib/scaffolder/template/default.php create mode 100644 main/auth/shibboleth/app/lib/scaffolder/template/public.php diff --git a/main/auth/shibboleth/app/lib/scaffolder/template/default.php b/main/auth/shibboleth/app/lib/scaffolder/template/default.php new file mode 100644 index 0000000000..52bf8fbbde --- /dev/null +++ b/main/auth/shibboleth/app/lib/scaffolder/template/default.php @@ -0,0 +1,145 @@ + + */ + +echo ' + +/** + * This file is autogenerated. Do not modifiy it. + */ + +/** + * + * Model for table + * + * @copyright (c) 2012 University of Geneva + * @license GNU General Public License - http://www.gnu.org/copyleft/gpl.html + * @author Laurent Opprecht + */ +class + +{ + + /** + * Store for objects. Interact with the database. + * + * @return Store + */ + public static function store() + { + static $result = false; + if (empty($result)) + { + $result = new Store(); + } + return $result; + } + + /** + * + * @return + */ + public static function create($data = null) + { + return self::store()->create_object($data); + } + + + public $name; ?> = def ? $field->def : 'null'; ?>; + + + /** + * + * @return bool + */ + public function save() + { + return self::store()->save($this); + } + +} + +/** + * Store for objects. Interact with the database. + * + * @copyright (c) 2012 University of Geneva + * @license GNU General Public License - http://www.gnu.org/copyleft/gpl.html + * @author Laurent Opprecht + */ +class Store extends Store +{ + + /** + * + * @return Store + */ + public static function instance() + { + static $result = false; + if (empty($result)) + { + $result = new self(); + } + return $result; + } + + public function __construct() + { + parent::__construct('', '', ''); + } + + /** + * + * @return + */ + public function get($w) + { + $args = func_get_args(); + $f = array('parent', 'get'); + return call_user_func_array($f, $args); + } + + /** + * + * @return + */ + public function create_object($data) + { + return parent::create_object($data); + } + + + /** + * + * @return + */ + public function get_by_($value) + { + return $this->get(array('' => $value)); + } + + /** + * + * @return bool + */ + public function _exists($value) + { + return $this->exist(array('' => $value)); + } + + /** + * + * @return bool + */ + public function delete_by_($value) + { + return $this->delete(array('' => $value)); + } + +} \ No newline at end of file diff --git a/main/auth/shibboleth/app/lib/scaffolder/template/public.php b/main/auth/shibboleth/app/lib/scaffolder/template/public.php new file mode 100644 index 0000000000..e48d3caff9 --- /dev/null +++ b/main/auth/shibboleth/app/lib/scaffolder/template/public.php @@ -0,0 +1,38 @@ + + */ + +echo ' + +/** + * + * Model for table + * + * @copyright (c) 2012 University of Geneva + * @license GNU General Public License - http://www.gnu.org/copyleft/gpl.html + * @author Laurent Opprecht + */ +class + +{ + + +} + +/** + * Store for objects. Interact with the database. + * + * @copyright (c) 2012 University of Geneva + * @license GNU General Public License - http://www.gnu.org/copyleft/gpl.html + * @author Laurent Opprecht + */ +class Store extends Store +{ + +} \ No newline at end of file