public static function getAllOnArticleID($article_id) { $select = new Select(self::$db); $select->from(self::$table, "*")->where("`article_id` = " . self::$db->getSQ(), array($article_id))->order("date"); $comments = ObjectDB::buildMultiple(__CLASS__, self::$db->select($select)); $comments = ObjectDB::addSubObject($comments, "UserDB", "user", "user_id"); return $comments; }
public static function getAllOnArticleID($article_id) { $select = new Select(self::$db); $select->from(self::$table, "*")->where("`article_id` = " . self::$db->getSQ(), array($article_id))->order("date"); //сортировка по дате $comments = ObjectDB::buildMultiple(__CLASS__, self::$db->select($select)); $comments = ObjectDB::addSubObject($comments, "UserDB", "user", "user_id"); //добавление к коментариям данных пользователя return $comments; }