partkeepr

fork of partkeepr
git clone https://git.e1e0.net/partkeepr.git
Log | Files | Refs | Submodules | README | LICENSE

commit 32d783b6603e5071e275638631c38ad690b7732e
parent 4b59fe26016850e1da0af2de05322195efc8c683
Author: Felicitus <felicitus@felicitus.org>
Date:   Mon,  3 Aug 2015 14:00:18 +0200

Added (fake) PHP array support to generate the models correctly

Diffstat:
Msrc/PartKeepr/DoctrineReflectionBundle/Services/ReflectionService.php | 3+++
Asrc/PartKeepr/FrontendBundle/Resources/public/js/Data/field/Array.js | 22++++++++++++++++++++++
Msrc/PartKeepr/FrontendBundle/Resources/views/index.html.twig | 1+
3 files changed, 26 insertions(+), 0 deletions(-)

diff --git a/src/PartKeepr/DoctrineReflectionBundle/Services/ReflectionService.php b/src/PartKeepr/DoctrineReflectionBundle/Services/ReflectionService.php @@ -173,6 +173,9 @@ class ReflectionService case "decimal": return "number"; break; + case "array": + return "array"; + break; } return "undefined"; diff --git a/src/PartKeepr/FrontendBundle/Resources/public/js/Data/field/Array.js b/src/PartKeepr/FrontendBundle/Resources/public/js/Data/field/Array.js @@ -0,0 +1,21 @@ +Ext.define('PartKeepr.data.field.Array', { + extend: 'Ext.data.field.Field', + + alias: [ + 'data.field.array' + ], + + /** + * @property [trueRe] + * Values matching this regular expression are considered `true`. + */ + trueRe: /^\s*(?:true|yes|on|1)\s*$/i, + + convert: function (v) { + return v; + }, + + getType: function() { + return 'array'; + } +});+ \ No newline at end of file diff --git a/src/PartKeepr/FrontendBundle/Resources/views/index.html.twig b/src/PartKeepr/FrontendBundle/Resources/views/index.html.twig @@ -39,6 +39,7 @@ 'js/packages/extjs6/build/ext-all-debug.js' 'js/packages/extjs6/build/packages/charts/classic/charts.js' 'js/packages/extjs6/build/packages/ux/classic/ux.js' + '@PartKeeprFrontendBundle/Resources/public/js/Data/field/Array.js' '@PartKeeprFrontendBundle/Resources/public/js/Util/Crypto/isaac.js' '@PartKeeprFrontendBundle/Resources/public/js/Util/Crypto/bcrypt.js' '@PartKeeprFrontendBundle/Resources/public/js/Util/Crypto/core.js'