Changeset 5715 for trunk/prototype/api/controller.php
- Timestamp:
- 03/13/12 18:23:02 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/prototype/api/controller.php
r5637 r5715 27 27 static $tx = array(); 28 28 static $isConcept = array(); 29 static $hasOne = array(); 29 30 static $txID = 0; 30 31 static $wallet; … … 161 162 $links = array(); 162 163 self::$isConcept[ $concept ] = array(); 164 self::$hasOne[ $concept ] = array(); 163 165 164 166 if( isset(self::$config[ $concept ][ 'model.hasOne' ]) ) … … 171 173 172 174 $links[$linkName] = $target; 173 self::$ isConcept[ $concept ][ $linkName ] = true;175 self::$hasOne[ $concept ][ $linkName ] = true; 174 176 } 175 177 if( isset(self::$config[ $concept ][ 'model.depends' ]) ) … … 182 184 183 185 $links[$linkName] = $target; 186 self::$hasOne[ $concept ][ $linkName ] = true; 184 187 self::$isConcept[ $concept ][ $linkName ] = true; 185 188 } … … 204 207 205 208 return( isset(self::$isConcept[ $concept ][ $linkName ]) ); 209 } 210 211 public static function hasOne( $concept, $linkName ) 212 { 213 if( !isset( self::$hasOne[ $concept ] ) ) 214 self::links( $concept ); 215 216 return( isset(self::$hasOne[ $concept ][ $linkName ]) ); 206 217 } 207 218 … … 646 657 647 658 foreach( $postpone as $linkTarget => $dt ) 659 { 660 if( Controller::hasOne( $URI['concept'], $linkNames[ $linkTarget ] ) ) 661 $dt = array( $dt ); 662 648 663 foreach( $dt as $ii => $value ) 649 664 { … … 655 670 self::put( array( 'concept' => $linkTarget ), $value, &$txIds ); 656 671 } 657 672 } 658 673 if( $commit ) 659 674 {
Note: See TracChangeset
for help on using the changeset viewer.