LittlePig Class Reference

List of all members.

Public Member Functions

 say ($strText)
 setName ($strName)
 buildHouse ($strType)
 getHouse ()
 happyEverAfter ()
 isEaten ()
 isKilled ()
 wakeUpBy (Wolf $objWolf)

Protected Attributes

 $strName
 $objHouse


Detailed Description

Little pigs of the example of the code to diagram

Author:
Thiago Henrique Ramos da Mata <thiago.henrique.mata@gmail.com>

Definition at line 14 of file Pig.class.php.


Member Function Documentation

buildHouse ( strType  ) 

Make the Little Pig buid the house of the received type

Parameters:
string $strType type of the house
Returns:
LittlePig me

Definition at line 60 of file Pig.class.php.

References $objHouse.

00061     {
00062         $objHouse = new House();
00063         $objHouse->setType( $strType );
00064         $this->objHouse = $objHouse;
00065         $this->objHouse->setPig( $this );
00066         return $this;
00067     }

getHouse (  ) 

Get the house of the little pig

Returns:
House

Definition at line 74 of file Pig.class.php.

00075     {
00076         return $this->objHouse;
00077     }

happyEverAfter (  ) 

Little Pig celebrate the happy ever after

Definition at line 83 of file Pig.class.php.

References say().

Referenced by wakeUpBy().

00084     {
00085         $this->say( "i am happy ever after!" );
00086     }

isEaten (  ) 

Little pig it is eaten

Definition at line 91 of file Pig.class.php.

00092     {
00093 
00094     }

isKilled (  ) 

Little pig is killed

Definition at line 100 of file Pig.class.php.

00101     {
00102 
00103     }

say ( strText  ) 

The pig speak the received text

Parameters:
string $strText
Returns:
LittlePig

Definition at line 36 of file Pig.class.php.

References print.

Referenced by happyEverAfter().

00037     {
00038         print "pig say: " . $strText . "<br/>\n";
00039         return $this;
00040     }

setName ( strName  ) 

Set the Little Pig name

Parameters:
string $strName
Returns:
LittlePig me

Definition at line 48 of file Pig.class.php.

References $strName.

00049     {
00050         $this->strName = $strName;
00051         return $this;
00052     }

wakeUpBy ( Wolf objWolf  ) 

Little pig is wake up by the wolf

1. little pig kill the wolf 2. little pig is happy ever after

Definition at line 113 of file Pig.class.php.

References happyEverAfter(), and Wolf::isKilled().

00114     {
00115         $objWolf->isKilled();
00116         $this->happyEverAfter();
00117     }


Member Data Documentation

$objHouse [protected]

Little Pig House

House

Definition at line 28 of file Pig.class.php.

Referenced by buildHouse().

$strName [protected]

Little Pig name

string

Definition at line 21 of file Pig.class.php.

Referenced by setName().


The documentation for this class was generated from the following file:

Generated on Thu Feb 3 03:55:03 2011 for CodeToDiagram by  doxygen 1.5.9