git-svn-id: http://svn.cleancode.org/svn/pickles@109 4d10bc64-7434-11dc-a737-d2d0f8310089
29 lines
539 B
PHP
29 lines
539 B
PHP
<?php
|
|
|
|
class store_category extends store {
|
|
|
|
protected $display = DISPLAY_SMARTY;
|
|
|
|
public function __default() {
|
|
|
|
$category = $this->db->getRow("
|
|
SELECT id, name, permalink, description
|
|
FROM categories
|
|
WHERE permalink = '{$_REQUEST['permalink']}';
|
|
");
|
|
|
|
$this->setPublic('category', $category);
|
|
|
|
$sql = "
|
|
SELECT p.*
|
|
FROM products AS p
|
|
INNER JOIN category_xref as c
|
|
ON p.id = c.product_id
|
|
WHERE c.category_id = '{$category['id']}';
|
|
";
|
|
|
|
$this->setPublic('products', $this->db->getArray($sql));
|
|
}
|
|
}
|
|
|
|
?>
|