\cheetahGoal

Class Goal Models a goal from the goals table

Summary

Methods
Properties
Constants
__construct()
tableName()
fromRow()
getFromMatchId()
toArray()
toJsonArray()
$id
$match
$player
$minute
$homeScore
$awayScore
$penalty
$owngoal
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Properties

$id

$id : \cheetah\int:

Type

\cheetah\int: — The ID of the Goal object in the database

$match

$match : \cheetah\Match:

Type

\cheetah\Match: — The match in which the goal occured

$player

$player : \cheetah\Player:

Type

\cheetah\Player: — The player that shot this goal

$minute

$minute : \cheetah\int:

Type

\cheetah\int: — The minute in which the goal fell

$homeScore

$homeScore : \cheetah\int:

Type

\cheetah\int: — The score of the home team after this goal

$awayScore

$awayScore : \cheetah\int:

Type

\cheetah\int: — The score of the away team after this goal

$penalty

$penalty : \cheetah\bool:

Type

\cheetah\bool: — Indicates if this goal is a penalty or not

$owngoal

$owngoal : \cheetah\bool:

Type

\cheetah\bool: — Indicates if the goal is an own goal or not

Methods

__construct()

__construct(\cheetah\int  $id, \cheetah\Match  $match, \cheetah\Player  $player, \cheetah\int  $minute, \cheetah\int  $homeScore, \cheetah\int  $awayScore, \cheetah\bool  $penalty, \cheetah\bool  $owngoal) 

Goal constructor.

Parameters

\cheetah\int $id
\cheetah\Match $match
\cheetah\Player $player
\cheetah\int $minute
\cheetah\int $homeScore
\cheetah\int $awayScore
\cheetah\bool $penalty
\cheetah\bool $owngoal

tableName()

tableName() : \cheetah\string:

Defines the table name for the Goal class.

Returns

\cheetah\string: —

'goals'

fromRow()

fromRow(\mysqli  $db, array  $row) : \cheetah\Model:

Generates a Goal object from a database row

Parameters

\mysqli $db
array $row

Returns

\cheetah\Model: —

The generated Goal object

getFromMatchId()

getFromMatchId(\mysqli  $db, \cheetah\int  $matchId) : \cheetah\array:

Retrieves all goals in a match

Parameters

\mysqli $db
\cheetah\int $matchId

Returns

\cheetah\array: —

An array of goals that fell during the match

toArray()

toArray() : \cheetah\array:

Returns

\cheetah\array: —

The array representation of the Goal

toJsonArray()

toJsonArray() : \cheetah\array:

Returns

\cheetah\array: —

The JSON array representation of the Goal