Class: Special_Model

Source Location: /tinymvc/myapp/models/special_model.php

Class Overview [line 9]

AbstractModel
   |
   --Special_Model

Data model for specials. Handles retrieving specials based on various criteria.

Author(s):

  • Monte Ohrt

Version:

Copyright:

Variables

Constants

Methods


Inherited Variables

Inherited Constants

Inherited Methods

Class: AbstractModel

AbstractModel::__construct()
class constructor


Class Details

Data model for specials. Handles retrieving specials based on various criteria.

Tags:

[ Top ]


Class Variables


Class Methods

filterByZipCode

void filterByZipCode( array $specials, string $zipCode)

[line 19]

Given a list of specials and zip code, filters the specials down to specials which are available in the given zip code.

Parameters:

  • array $specials - The list of specials to filter.
  • string $zipCode - The zip code to use when filtering specials. Must be a 5-digit string with numeric digits only.

[ Top ]

getSpecialById

array getSpecialById( int $id)

[line 102]

Retrieves a single special by its id.

Tags:

  • return - An associate array with all the special's data.

Parameters:

  • int $id - The special id.

[ Top ]

getSpecialsByArea

array getSpecialsByArea( string $zipCode)

[line 84]

Retrieves a list of specials available in the given zip code.

Parameters:

  • string $zipCode - The zip code to match with.

[ Top ]

getSpecialsByIngredient

array getSpecialsByIngredient( string $query)

[line 63]

Retrieves a list of specials which match $query by the ingredient(s) associated with the special.

Parameters:

  • string $query - The query to match with.

[ Top ]

getSpecialsByName

array getSpecialsByName( string $query)

[line 42]

Retrieves a list of specials which match $query by name.

Parameters:

  • string $query - The query to match with.

[ Top ]

getSpecialsForRecipe

array getSpecialsForRecipe( int $recipeId, [string $zipCode = null])

[line 124]

Retrieves a list of associate

Parameters:

  • int $recipeId - The recipe id for which to return associated specials.
  • string $zipCode - [Optional] The zip code in which to search for associated specials.

[ Top ]


Class Constants


Documentation generated on Tue, 26 May 2009 14:50:38 -0700 by phpDocumentor 1.4.1