/** * Returns the list of the comments attached to the object. The options array * can contain several options : * - order : order of the comments * * @param BaseObject $object * @param Array $options * @param Criteria $criteria * * @return Array */ public function getComments(BaseObject $object, $options = array(), Criteria $criteria = null) { $c = $this->getCommentsCriteria($object, $options, $criteria); $comment_objects = sfCommentPeer::doSelect($c); $comments = array(); foreach ($comment_objects as $comment_object) { $comment = $comment_object->toArray(); $comments[] = $comment; } return $comments; }
public static function retrieveByPKs($pks, $con = null) { if ($con === null) { $con = Propel::getConnection(self::DATABASE_NAME); } $objs = null; if (empty($pks)) { $objs = array(); } else { $criteria = new Criteria(); $criteria->add(sfCommentPeer::ID, $pks, Criteria::IN); $objs = sfCommentPeer::doSelect($criteria, $con); } return $objs; }