@@ -91,7 +91,7 @@ function _Array(conf) {
91
91
92
92
// init
93
93
arrDb . forEach ( function ( val ) {
94
- if ( type . indexOf ( '@' ) !== - 1 ) {
94
+ if ( $metamodel . isClassName ( type ) ) {
95
95
arr . push ( $helper . getRuntime ( ) . require ( val ) ) ;
96
96
} else {
97
97
arr . push ( val ) ;
@@ -106,7 +106,7 @@ function _Array(conf) {
106
106
107
107
if ( ! isReadOnly ) {
108
108
109
- isClass = type . indexOf ( '@' ) !== - 1 ;
109
+ isClass = $metamodel . isClassName ( type ) ;
110
110
111
111
if ( isClass ) {
112
112
if ( val && $metamodel . inheritFrom ( val . constructor . name , type . replace ( '@' , '' ) ) ) {
@@ -222,7 +222,7 @@ function _Array(conf) {
222
222
} ) ;
223
223
}
224
224
225
- isClass = type . indexOf ( '@' ) !== - 1 ;
225
+ isClass = $metamodel . isClassName ( type ) ;
226
226
227
227
if ( isClass ) {
228
228
result = store [ val ] ;
@@ -360,7 +360,7 @@ function _Array(conf) {
360
360
length = result . length ;
361
361
for ( i = 0 ; i < length ; i ++ ) {
362
362
363
- isClass = type . indexOf ( '@' ) !== - 1 ;
363
+ isClass = $metamodel . isClassName ( type ) ;
364
364
if ( isClass ) {
365
365
data = store [ result [ i ] ] ;
366
366
} else {
@@ -711,7 +711,7 @@ function addProperties(model, Class, classId) {
711
711
if (
712
712
! (
713
713
$metamodel . isValidType ( val , type ) &&
714
- ( $metamodel . inheritFrom ( val . constructor . name , type . replace ( '@' , '' ) ) && ( type . indexOf ( '@' ) !== - 1 ) ) )
714
+ ( $metamodel . inheritFrom ( val . constructor . name , type . replace ( '@' , '' ) ) && $metamodel . isClassName ( type ) ) )
715
715
) {
716
716
result = result && false ;
717
717
}
@@ -724,7 +724,7 @@ function addProperties(model, Class, classId) {
724
724
var result = [ ] ;
725
725
726
726
coll . forEach ( function ( val ) {
727
- if ( type [ 0 ] . indexOf ( '@' ) !== - 1 ) {
727
+ if ( $metamodel . isClassName ( type ) ) {
728
728
switch ( true ) {
729
729
case typeof val === 'string' :
730
730
result . push ( val ) ;
@@ -777,7 +777,7 @@ function addProperties(model, Class, classId) {
777
777
778
778
component = search [ 0 ] ;
779
779
realVal = _getRealCollection ( position , propertyType [ 0 ] ) ;
780
-
780
+
781
781
$workflow . state ( {
782
782
'component' : this . id ( ) ,
783
783
'state' : propertyName ,
@@ -802,7 +802,7 @@ function addProperties(model, Class, classId) {
802
802
if ( typeof position === 'number' ) {
803
803
val = $db . store [ classId ] [ this . id ( ) ] [ propertyName ] [ position ] ;
804
804
if ( val ) {
805
- if ( propertyType [ 0 ] . indexOf ( '@' ) !== - 1 ) {
805
+ if ( $metamodel . isClassName ( propertyType [ 0 ] ) ) {
806
806
realVal = $helper . getRuntime ( ) . require ( val ) ;
807
807
} else {
808
808
realVal = val ;
@@ -820,14 +820,14 @@ function addProperties(model, Class, classId) {
820
820
} else {
821
821
if (
822
822
$metamodel . isValidType ( value , propertyType [ 0 ] ) ||
823
- ( $metamodel . inheritFrom ( value . constructor . name , propertyType [ 0 ] . replace ( '@' , '' ) ) && ( propertyType [ 0 ] . indexOf ( '@' ) !== - 1 ) )
823
+ ( $metamodel . inheritFrom ( value . constructor . name , propertyType [ 0 ] . replace ( '@' , '' ) ) && $metamodel . isClassName ( propertyType [ 0 ] ) )
824
824
) {
825
825
search = $db [ classId ] . find ( {
826
826
'_id' : this . id ( )
827
827
} ) ;
828
828
if ( search . length ) {
829
829
830
- if ( propertyType [ 0 ] . indexOf ( '@' ) !== - 1 ) {
830
+ if ( $metamodel . isClassName ( propertyType [ 0 ] ) ) {
831
831
switch ( true ) {
832
832
case typeof value === 'string' :
833
833
realVal = value ;
@@ -880,7 +880,7 @@ function addProperties(model, Class, classId) {
880
880
component = $db . store [ classId ] [ this . id ( ) ] ;
881
881
if ( component ) {
882
882
switch ( true ) {
883
- case propertyType . indexOf ( '@' ) !== - 1 :
883
+ case $metamodel . isClassName ( propertyType ) :
884
884
propertyValue = get ( component [ propertyName ] ) ;
885
885
break ;
886
886
case propertyType === 'date' :
@@ -920,7 +920,7 @@ function addProperties(model, Class, classId) {
920
920
component = search [ 0 ] ;
921
921
922
922
switch ( true ) {
923
- case propertyType . indexOf ( '@' ) !== - 1 :
923
+ case $metamodel . isClassName ( propertyType ) :
924
924
if ( value === null ) {
925
925
component [ propertyName ] = value ;
926
926
} else {
@@ -1140,7 +1140,7 @@ function addStructure(path, name, model, id) {
1140
1140
component = $db . store [ model ] [ id ] ;
1141
1141
if ( component ) {
1142
1142
switch ( true ) {
1143
- case propertyType . indexOf ( '@' ) !== - 1 :
1143
+ case $metamodel . isClassName ( propertyType ) :
1144
1144
propertyValue = get ( getStructureValue ( model , id , fullPath ) ) ;
1145
1145
break ;
1146
1146
case propertyType === 'date' :
@@ -1173,7 +1173,7 @@ function addStructure(path, name, model, id) {
1173
1173
component = search [ 0 ] ;
1174
1174
1175
1175
switch ( true ) {
1176
- case propertyType . indexOf ( '@' ) !== - 1 :
1176
+ case $metamodel . isClassName ( propertyType ) :
1177
1177
setStructureValue ( model , id , fullPath , value . id ( ) ) ;
1178
1178
break ;
1179
1179
case propertyType === 'date' :
0 commit comments