@@ -285,22 +285,22 @@ |
||
285 | 285 | return "DATETIMECMP($params[0]; $params[1])"; |
286 | 286 | break; |
287 | 287 | case ODataConstants::DATETIME_YEAR: |
288 | - return 'EXTRACT(YEAR from '.$params[0].')'; |
|
288 | + return 'EXTRACT(YEAR from ' . $params[0] . ')'; |
|
289 | 289 | break; |
290 | 290 | case ODataConstants::DATETIME_MONTH: |
291 | - return 'EXTRACT(MONTH from '.$params[0].')'; |
|
291 | + return 'EXTRACT(MONTH from ' . $params[0] . ')'; |
|
292 | 292 | break; |
293 | 293 | case ODataConstants::DATETIME_DAY: |
294 | - return 'EXTRACT(DAY from '.$params[0].')'; |
|
294 | + return 'EXTRACT(DAY from ' . $params[0] . ')'; |
|
295 | 295 | break; |
296 | 296 | case ODataConstants::DATETIME_HOUR: |
297 | - return 'EXTRACT(HOUR from '.$params[0].')'; |
|
297 | + return 'EXTRACT(HOUR from ' . $params[0] . ')'; |
|
298 | 298 | break; |
299 | 299 | case ODataConstants::DATETIME_MINUTE: |
300 | - return 'EXTRACT(MINUTE from '.$params[0].')'; |
|
300 | + return 'EXTRACT(MINUTE from ' . $params[0] . ')'; |
|
301 | 301 | break; |
302 | 302 | case ODataConstants::DATETIME_SECOND: |
303 | - return 'EXTRACT(SECOND from '.$params[0].')'; |
|
303 | + return 'EXTRACT(SECOND from ' . $params[0] . ')'; |
|
304 | 304 | break; |
305 | 305 | case ODataConstants::MATHFUN_ROUND: |
306 | 306 | return "ROUND($params[0])"; |
@@ -189,7 +189,7 @@ discard block |
||
189 | 189 | $query = 'SELECT * FROM `wp_posts` WHERE' |
190 | 190 | ." wp_posts.post_type = 'post'" |
191 | 191 | ." AND wp_posts.post_status = 'publish'" |
192 | - .' AND wp_posts.ID = '.$namedKeyValues['PostID'][0]; |
|
192 | + .' AND wp_posts.ID = ' . $namedKeyValues['PostID'][0]; |
|
193 | 193 | $stmt = mysql_query($query); |
194 | 194 | |
195 | 195 | //If resource not found return null to the library |
@@ -205,7 +205,7 @@ discard block |
||
205 | 205 | .' FROM `wp_terms` AS t INNER JOIN `wp_term_taxonomy` as tt' |
206 | 206 | .' ON tt.term_id = t.term_id' |
207 | 207 | ." WHERE tt.taxonomy = 'post_tag'" |
208 | - .' AND t.term_id = '.$namedKeyValues['TagID'][0]; |
|
208 | + .' AND t.term_id = ' . $namedKeyValues['TagID'][0]; |
|
209 | 209 | $stmt = mysql_query($query); |
210 | 210 | |
211 | 211 | //If resource not found return null to the library |
@@ -221,7 +221,7 @@ discard block |
||
221 | 221 | .' FROM `wp_terms` AS t INNER JOIN `wp_term_taxonomy` as tt' |
222 | 222 | .' ON tt.term_id = t.term_id' |
223 | 223 | ." WHERE tt.taxonomy = 'category'" |
224 | - .' AND t.term_id = '.$namedKeyValues['CategoryID'][0]; |
|
224 | + .' AND t.term_id = ' . $namedKeyValues['CategoryID'][0]; |
|
225 | 225 | $stmt = mysql_query($query); |
226 | 226 | |
227 | 227 | //If resource not found return null to the library |
@@ -235,7 +235,7 @@ discard block |
||
235 | 235 | case 'Comments': |
236 | 236 | $query = 'SELECT * FROM `wp_comments`' |
237 | 237 | .' WHERE comment_approved = 1' |
238 | - .' AND comment_ID = '.$namedKeyValues['CommentID'][0]; |
|
238 | + .' AND comment_ID = ' . $namedKeyValues['CommentID'][0]; |
|
239 | 239 | $stmt = mysql_query($query); |
240 | 240 | |
241 | 241 | //If resource not found return null to the library |
@@ -247,7 +247,7 @@ discard block |
||
247 | 247 | $result = $this->_serializeComment($data); |
248 | 248 | break; |
249 | 249 | case 'Users': |
250 | - $query = 'SELECT * FROM `wp_users` WHERE ID = '.$namedKeyValues['UserID'][0]; |
|
250 | + $query = 'SELECT * FROM `wp_users` WHERE ID = ' . $namedKeyValues['UserID'][0]; |
|
251 | 251 | $stmt = mysql_query($query); |
252 | 252 | |
253 | 253 | //If resource not found return null to the library |
@@ -344,7 +344,7 @@ discard block |
||
344 | 344 | |
345 | 345 | $result = $this->_serializeComments($stmt); |
346 | 346 | } else { |
347 | - die('Post does not have navigation porperty with name: '.$navigationPropName); |
|
347 | + die('Post does not have navigation porperty with name: ' . $navigationPropName); |
|
348 | 348 | } |
349 | 349 | break; |
350 | 350 | |
@@ -369,7 +369,7 @@ discard block |
||
369 | 369 | |
370 | 370 | $result = $this->_serializePosts($stmt); |
371 | 371 | } else { |
372 | - die('Tag does not have navigation porperty with name: '.$navigationPropName); |
|
372 | + die('Tag does not have navigation porperty with name: ' . $navigationPropName); |
|
373 | 373 | } |
374 | 374 | break; |
375 | 375 | |
@@ -394,12 +394,12 @@ discard block |
||
394 | 394 | |
395 | 395 | $result = $this->_serializePosts($stmt); |
396 | 396 | } else { |
397 | - die('Category does not have navigation porperty with name: '.$navigationPropName); |
|
397 | + die('Category does not have navigation porperty with name: ' . $navigationPropName); |
|
398 | 398 | } |
399 | 399 | break; |
400 | 400 | |
401 | 401 | case $srcClass == 'Comment': |
402 | - die('Comment does not have navigation porperty with name: '.$navigationPropName); |
|
402 | + die('Comment does not have navigation porperty with name: ' . $navigationPropName); |
|
403 | 403 | break; |
404 | 404 | |
405 | 405 | case $srcClass == 'User': |
@@ -431,7 +431,7 @@ discard block |
||
431 | 431 | |
432 | 432 | $result = $this->_serializeComments($stmt); |
433 | 433 | } else { |
434 | - die('User does not have navigation porperty with name: '.$navigationPropName); |
|
434 | + die('User does not have navigation porperty with name: ' . $navigationPropName); |
|
435 | 435 | } |
436 | 436 | break; |
437 | 437 | } |
@@ -484,7 +484,7 @@ discard block |
||
484 | 484 | .' ON tr.term_taxonomy_id = tt.term_taxonomy_id' |
485 | 485 | ." WHERE tt.taxonomy IN ('post_tag')" |
486 | 486 | ." AND tr.object_id IN ($sourceEntityInstance->PostID)" |
487 | - .' AND tt.term_id = '.$namedKeyValues['TagID'][0]; |
|
487 | + .' AND tt.term_id = ' . $namedKeyValues['TagID'][0]; |
|
488 | 488 | $stmt = mysql_query($query); |
489 | 489 | $result = $this->_serializeTags($stmt); |
490 | 490 | } elseif ($navigationPropName == 'Categories') { |
@@ -496,18 +496,18 @@ discard block |
||
496 | 496 | .' ON tr.term_taxonomy_id = tt.term_taxonomy_id' |
497 | 497 | ." WHERE tt.taxonomy IN ('category')" |
498 | 498 | ." AND tr.object_id IN ($sourceEntityInstance->PostID)" |
499 | - .' AND tt.term_id = '.$namedKeyValues['CategoryID'][0]; |
|
499 | + .' AND tt.term_id = ' . $namedKeyValues['CategoryID'][0]; |
|
500 | 500 | $stmt = mysql_query($query); |
501 | 501 | $result = $this->_serializeCategories($stmt); |
502 | 502 | } elseif ($navigationPropName == 'Comments') { |
503 | 503 | $query = 'SELECT * FROM `wp_comments`' |
504 | 504 | .' WHERE comment_approved = 1' |
505 | 505 | ." AND comment_post_ID = $sourceEntityInstance->PostID" |
506 | - .' AND comment_ID = '.$namedKeyValues['CommentID'][0]; |
|
506 | + .' AND comment_ID = ' . $namedKeyValues['CommentID'][0]; |
|
507 | 507 | $stmt = mysql_query($query); |
508 | 508 | $result = $this->_serializeComments($stmt); |
509 | 509 | } else { |
510 | - die('Post does not have navigation porperty with name: '.$navigationPropName); |
|
510 | + die('Post does not have navigation porperty with name: ' . $navigationPropName); |
|
511 | 511 | } |
512 | 512 | break; |
513 | 513 | |
@@ -522,11 +522,11 @@ discard block |
||
522 | 522 | ." WHERE tt.term_id = $sourceEntityInstance->TagID" |
523 | 523 | ." AND p.post_type = 'post'" |
524 | 524 | ." AND p.post_status = 'publish'" |
525 | - .' AND p.ID = '.$namedKeyValues['PostID'][0]; |
|
525 | + .' AND p.ID = ' . $namedKeyValues['PostID'][0]; |
|
526 | 526 | $stmt = mysql_query($query); |
527 | 527 | $result = $this->_serializePosts($stmt); |
528 | 528 | } else { |
529 | - die('Tag does not have navigation porperty with name: '.$navigationPropName); |
|
529 | + die('Tag does not have navigation porperty with name: ' . $navigationPropName); |
|
530 | 530 | } |
531 | 531 | break; |
532 | 532 | |
@@ -541,16 +541,16 @@ discard block |
||
541 | 541 | ." WHERE tt.term_id = $sourceEntityInstance->CategoryID" |
542 | 542 | ." AND p.post_type = 'post'" |
543 | 543 | ." AND p.post_status = 'publish'" |
544 | - .' AND p.ID = '.$namedKeyValues['PostID'][0]; |
|
544 | + .' AND p.ID = ' . $namedKeyValues['PostID'][0]; |
|
545 | 545 | $stmt = mysql_query($query); |
546 | 546 | $result = $this->_serializePosts($stmt); |
547 | 547 | } else { |
548 | - die('Category does not have navigation porperty with name: '.$navigationPropName); |
|
548 | + die('Category does not have navigation porperty with name: ' . $navigationPropName); |
|
549 | 549 | } |
550 | 550 | break; |
551 | 551 | |
552 | 552 | case $srcClass == 'Comment': |
553 | - die('Comment does not have navigation porperty with name: '.$navigationPropName); |
|
553 | + die('Comment does not have navigation porperty with name: ' . $navigationPropName); |
|
554 | 554 | break; |
555 | 555 | |
556 | 556 | case $srcClass == 'User': |
@@ -559,18 +559,18 @@ discard block |
||
559 | 559 | ." wp_posts.post_type = 'post'" |
560 | 560 | ." AND wp_posts.post_status = 'publish'" |
561 | 561 | ." AND wp_posts.post_author = $sourceEntityInstance->UserID" |
562 | - .' AND wp_posts.ID = '.$namedKeyValues['PostID'][0]; |
|
562 | + .' AND wp_posts.ID = ' . $namedKeyValues['PostID'][0]; |
|
563 | 563 | $stmt = mysql_query($query); |
564 | 564 | $result = $this->_serializePosts($stmt); |
565 | 565 | } elseif ($navigationPropName == 'Comments') { |
566 | 566 | $query = 'SELECT * FROM `wp_comments`' |
567 | 567 | .' WHERE comment_approved = 1' |
568 | 568 | ." AND wp_comments.user_id = $sourceEntityInstance->UserID" |
569 | - .' AND wp_comments.comment_ID = '.$namedKeyValues['CommentID'][0]; |
|
569 | + .' AND wp_comments.comment_ID = ' . $namedKeyValues['CommentID'][0]; |
|
570 | 570 | $stmt = mysql_query($query); |
571 | 571 | $result = $this->_serializeComments($stmt); |
572 | 572 | } else { |
573 | - die('User does not have navigation porperty with name: '.$navigationPropName); |
|
573 | + die('User does not have navigation porperty with name: ' . $navigationPropName); |
|
574 | 574 | } |
575 | 575 | break; |
576 | 576 | } |
@@ -616,7 +616,7 @@ discard block |
||
616 | 616 | $result = null; |
617 | 617 | } |
618 | 618 | } else { |
619 | - die('Post does not have navigation porperty with name: '.$navigationPropName); |
|
619 | + die('Post does not have navigation porperty with name: ' . $navigationPropName); |
|
620 | 620 | } |
621 | 621 | break; |
622 | 622 | |
@@ -651,7 +651,7 @@ discard block |
||
651 | 651 | $data = mysql_fetch_assoc($stmt); |
652 | 652 | $result = $this->_serializePost($data); |
653 | 653 | } else { |
654 | - die('Comment does not have navigation porperty with name: '.$navigationPropName); |
|
654 | + die('Comment does not have navigation porperty with name: ' . $navigationPropName); |
|
655 | 655 | } |
656 | 656 | break; |
657 | 657 | } |
@@ -172,7 +172,7 @@ |
||
172 | 172 | */ |
173 | 173 | protected function executePut() |
174 | 174 | { |
175 | - return $this->executeBase(function ($uriProcessor, $segment) { |
|
175 | + return $this->executeBase(function($uriProcessor, $segment) { |
|
176 | 176 | $requestMethod = $uriProcessor->getService()->getOperationContext()->incomingRequest()->getMethod(); |
177 | 177 | $resourceSet = $segment->getTargetResourceSetWrapper(); |
178 | 178 | $keyDescriptor = $segment->getKeyDescriptor(); |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | $xml = self::$xml = $input_xml; |
39 | 39 | } |
40 | 40 | $array[$xml->documentElement->tagName] = self::convert($xml->documentElement); |
41 | - self::$xml = null; // clear the xml node in the class for 2nd time use. |
|
41 | + self::$xml = null; // clear the xml node in the class for 2nd time use. |
|
42 | 42 | return $array; |
43 | 43 | } |
44 | 44 | /** |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | break; |
59 | 59 | case XML_ELEMENT_NODE: |
60 | 60 | // for each child node, call the covert function recursively |
61 | - for ($i=0, $m=$node->childNodes->length; $i<$m; $i++) { |
|
61 | + for ($i = 0, $m = $node->childNodes->length; $i < $m; $i++) { |
|
62 | 62 | $child = $node->childNodes->item($i); |
63 | 63 | $v = self::convert($child); |
64 | 64 | if (isset($child->tagName)) { |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | if (is_array($output)) { |
79 | 79 | // if only one node of its kind, assign it directly instead if array($value); |
80 | 80 | foreach ($output as $t => $v) { |
81 | - if (is_array($v) && count($v)==1) { |
|
81 | + if (is_array($v) && count($v) == 1) { |
|
82 | 82 | $output[$t] = $v[0]; |
83 | 83 | } |
84 | 84 | } |