@@ 351-374 (lines=24) @@ | ||
348 | } |
|
349 | break; |
|
350 | ||
351 | case ($srcClass == 'Tag'): |
|
352 | if ($navigationPropName == 'Posts') { |
|
353 | $query = "SELECT p . *" |
|
354 | ." FROM wp_posts AS p" |
|
355 | ." INNER JOIN wp_term_relationships AS tr" |
|
356 | ." ON p.ID = tr.object_id" |
|
357 | ." INNER JOIN wp_term_taxonomy AS tt" |
|
358 | ." ON tr.term_taxonomy_id = tt.term_taxonomy_id" |
|
359 | ." WHERE tt.term_id = $sourceEntityInstance->TagID" |
|
360 | ." AND p.post_type = 'post'" |
|
361 | ." AND p.post_status = 'publish'"; |
|
362 | if ($filter !== null) { |
|
363 | $query .= " AND $filter"; |
|
364 | } |
|
365 | $stmt = mysql_query($query); |
|
366 | if ( $stmt === false) { |
|
367 | die(mysql_error()); |
|
368 | } |
|
369 | ||
370 | $result = $this->_serializePosts($stmt); |
|
371 | } else { |
|
372 | die('Tag does not have navigation porperty with name: ' . $navigationPropName); |
|
373 | } |
|
374 | break; |
|
375 | ||
376 | case ($srcClass == 'Category'): |
|
377 | if ($navigationPropName == 'Posts') { |
|
@@ 376-399 (lines=24) @@ | ||
373 | } |
|
374 | break; |
|
375 | ||
376 | case ($srcClass == 'Category'): |
|
377 | if ($navigationPropName == 'Posts') { |
|
378 | $query = "SELECT p . *" |
|
379 | ." FROM wp_posts AS p" |
|
380 | ." INNER JOIN wp_term_relationships AS tr" |
|
381 | ." ON p.ID = tr.object_id" |
|
382 | ." INNER JOIN wp_term_taxonomy AS tt" |
|
383 | ." ON tr.term_taxonomy_id = tt.term_taxonomy_id" |
|
384 | ." WHERE tt.term_id = $sourceEntityInstance->CategoryID" |
|
385 | ." AND p.post_type = 'post'" |
|
386 | ." AND p.post_status = 'publish'"; |
|
387 | if ($filter !== null) { |
|
388 | $query .= " AND $filter"; |
|
389 | } |
|
390 | $stmt = mysql_query($query); |
|
391 | if ( $stmt === false) { |
|
392 | die(mysql_error()); |
|
393 | } |
|
394 | ||
395 | $result = $this->_serializePosts($stmt); |
|
396 | } else { |
|
397 | die('Category does not have navigation porperty with name: ' . $navigationPropName); |
|
398 | } |
|
399 | break; |
|
400 | ||
401 | case ($srcClass == 'Comment'): |
|
402 | die('Comment does not have navigation porperty with name: ' . $navigationPropName); |