, , , OO.
$question = new Question($id);
$comments = $question->getComments();
$answers = $question->getAnswers();
echo $question->getTitle();
echo $question->getText();
foreach ($comments as $comment)
echo $comments->getText();
:
( ) . OO.
$question = new Question($id);
$questionView = new QuestionView( $question );
$questionView->displayComments();
$questionView->displayAnswers();
.
, :
$question = new Question( $id );
$questionView = new QuestionView( $question );
$questionView->setPrinterFriendly();
$questionView->displayComments();
$questionView->displayAnswers();
, . (), - ; () - ( ).
, , . - , , , .
,
, :
Database -> Object -> Display Content
, , . , , , . , . , , - , .
, Comments; Questions Answers.
Comment :
CommentDB
CommentDB, , Comment . CommentDB :
, , , , , . , ( ).
:
$commentDb = new CommentDB();
$comment = $commentDb->create();
:
$comment->update( "new text" );
, , , .
CommentView
, CommentView Comment. , Comment . - . Comment CommentView . , , , -.
, , , CommentView.
: " get/set" , ?