mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Fix api docblocks for View layer classes.
This commit is contained in:
parent
390441d3b9
commit
16df061d66
18 changed files with 105 additions and 131 deletions
|
@ -224,7 +224,7 @@ class Helper extends Object {
|
|||
* Provides backwards compatibility access for setting values to the request object.
|
||||
*
|
||||
* @param string $name Name of the property being accessed.
|
||||
* @param mixed $value
|
||||
* @param mixed $value Value to set.
|
||||
* @return void
|
||||
* @deprecated This method will be removed in 3.0
|
||||
*/
|
||||
|
@ -299,7 +299,7 @@ class Helper extends Object {
|
|||
* Generate URL for given asset file. Depending on options passed provides full URL with domain name.
|
||||
* Also calls Helper::assetTimestamp() to add timestamp to local files
|
||||
*
|
||||
* @param string|array Path string or URL array
|
||||
* @param string|array $path Path string or URL array
|
||||
* @param array $options Options array. Possible keys:
|
||||
* `fullBase` Return full URL with domain name
|
||||
* `pathPrefix` Path prefix for relative URLs
|
||||
|
@ -665,7 +665,7 @@ class Helper extends Object {
|
|||
*
|
||||
* @param array|string $options If an array, should be an array of attributes that $key needs to be added to.
|
||||
* If a string or null, will be used as the View entity.
|
||||
* @param string $field
|
||||
* @param string $field Field name.
|
||||
* @param string $key The name of the attribute to be set, defaults to 'name'
|
||||
* @return mixed If an array was given for $options, an array with $key set will be returned.
|
||||
* If a string was supplied a string will be returned.
|
||||
|
@ -706,7 +706,7 @@ class Helper extends Object {
|
|||
*
|
||||
* @param array|string $options If an array, should be an array of attributes that $key needs to be added to.
|
||||
* If a string or null, will be used as the View entity.
|
||||
* @param string $field
|
||||
* @param string $field Field name.
|
||||
* @param string $key The name of the attribute to be set, defaults to 'value'
|
||||
* @return mixed If an array was given for $options, an array with $key set will be returned.
|
||||
* If a string was supplied a string will be returned.
|
||||
|
@ -881,8 +881,8 @@ class Helper extends Object {
|
|||
* Transforms a recordset from a hasAndBelongsToMany association to a list of selected
|
||||
* options for a multiple select element
|
||||
*
|
||||
* @param string|array $data
|
||||
* @param string $key
|
||||
* @param string|array $data Data array or model name.
|
||||
* @param string $key Field name.
|
||||
* @return array
|
||||
*/
|
||||
protected function _selectedArray($data, $key = 'id') {
|
||||
|
|
|
@ -64,7 +64,7 @@ class CacheHelper extends AppHelper {
|
|||
/**
|
||||
* Parses the view file and stores content for cache file building.
|
||||
*
|
||||
* @param string $viewFile
|
||||
* @param string $viewFile View file name.
|
||||
* @param string $output The output for the file.
|
||||
* @return string Updated content.
|
||||
*/
|
||||
|
@ -77,7 +77,7 @@ class CacheHelper extends AppHelper {
|
|||
/**
|
||||
* Parses the layout file and stores content for cache file building.
|
||||
*
|
||||
* @param string $layoutFile
|
||||
* @param string $layoutFile Layout file name.
|
||||
* @return void
|
||||
*/
|
||||
public function afterLayout($layoutFile) {
|
||||
|
@ -266,7 +266,8 @@ class CacheHelper extends AppHelper {
|
|||
*
|
||||
* @param string $content view content to write to a cache file.
|
||||
* @param string $timestamp Duration to set for cache file.
|
||||
* @param boolean $useCallbacks
|
||||
* @param boolean $useCallbacks Whether to include statements in cached file which
|
||||
* run callbacks.
|
||||
* @return boolean success of caching view.
|
||||
*/
|
||||
protected function _writeFile($content, $timestamp, $useCallbacks = false) {
|
||||
|
|
|
@ -140,7 +140,7 @@ class FormHelper extends AppHelper {
|
|||
* Guess the location for a model based on its name and tries to create a new instance
|
||||
* or get an already created instance of the model
|
||||
*
|
||||
* @param string $model
|
||||
* @param string $model Model name.
|
||||
* @return Model model instance
|
||||
*/
|
||||
protected function _getModel($model) {
|
||||
|
@ -254,7 +254,7 @@ class FormHelper extends AppHelper {
|
|||
/**
|
||||
* Returns if a field is required to be filled based on validation properties from the validating object.
|
||||
*
|
||||
* @param CakeValidationSet $validationRules
|
||||
* @param CakeValidationSet $validationRules Validation rules set.
|
||||
* @return boolean true if field is required to be filled, false otherwise
|
||||
*/
|
||||
protected function _isRequiredField($validationRules) {
|
||||
|
@ -1107,7 +1107,7 @@ class FormHelper extends AppHelper {
|
|||
/**
|
||||
* Generates input options array
|
||||
*
|
||||
* @param array $options
|
||||
* @param array $options Options list.
|
||||
* @return array Options
|
||||
*/
|
||||
protected function _parseOptions($options) {
|
||||
|
@ -1138,7 +1138,7 @@ class FormHelper extends AppHelper {
|
|||
/**
|
||||
* Generates list of options for multiple select
|
||||
*
|
||||
* @param array $options
|
||||
* @param array $options Options list.
|
||||
* @return array
|
||||
*/
|
||||
protected function _optionsOptions($options) {
|
||||
|
@ -1162,7 +1162,7 @@ class FormHelper extends AppHelper {
|
|||
/**
|
||||
* Magically set option type and corresponding options
|
||||
*
|
||||
* @param array $options
|
||||
* @param array $options Options list.
|
||||
* @return array
|
||||
*/
|
||||
protected function _magicOptions($options) {
|
||||
|
@ -1235,7 +1235,7 @@ class FormHelper extends AppHelper {
|
|||
/**
|
||||
* Generate format options
|
||||
*
|
||||
* @param array $options
|
||||
* @param array $options Options list.
|
||||
* @return array
|
||||
*/
|
||||
protected function _getFormat($options) {
|
||||
|
@ -1254,8 +1254,8 @@ class FormHelper extends AppHelper {
|
|||
/**
|
||||
* Generate label for input
|
||||
*
|
||||
* @param string $fieldName
|
||||
* @param array $options
|
||||
* @param string $fieldName Field name.
|
||||
* @param array $options Options list.
|
||||
* @return boolean|string false or Generated label element
|
||||
*/
|
||||
protected function _getLabel($fieldName, $options) {
|
||||
|
@ -1277,7 +1277,7 @@ class FormHelper extends AppHelper {
|
|||
/**
|
||||
* Calculates maxlength option
|
||||
*
|
||||
* @param array $options
|
||||
* @param array $options Options list.
|
||||
* @return array
|
||||
*/
|
||||
protected function _maxLength($options) {
|
||||
|
@ -1299,7 +1299,7 @@ class FormHelper extends AppHelper {
|
|||
/**
|
||||
* Generate div options for input
|
||||
*
|
||||
* @param array $options
|
||||
* @param array $options Options list.
|
||||
* @return array
|
||||
*/
|
||||
protected function _divOptions($options) {
|
||||
|
@ -1351,9 +1351,10 @@ class FormHelper extends AppHelper {
|
|||
* $options can contain a hash of id overrides. These overrides will be
|
||||
* used instead of the generated values if present.
|
||||
*
|
||||
* @param string $fieldName
|
||||
* @param string $label
|
||||
* @param array $options Options for the label element. 'NONE' option is deprecated and will be removed in 3.0
|
||||
* @param string $fieldName Field name.
|
||||
* @param string|array $label Label text or array with text and options.
|
||||
* @param array $options Options for the label element. 'NONE' option is
|
||||
* deprecated and will be removed in 3.0
|
||||
* @return string Generated label element
|
||||
*/
|
||||
protected function _inputLabel($fieldName, $label, $options) {
|
||||
|
@ -2668,9 +2669,9 @@ class FormHelper extends AppHelper {
|
|||
/**
|
||||
* Gets the input field name for the current tag
|
||||
*
|
||||
* @param array $options
|
||||
* @param string $field
|
||||
* @param string $key
|
||||
* @param array $options Options list.
|
||||
* @param string $field Field name.
|
||||
* @param string $key Key name.
|
||||
* @return array
|
||||
*/
|
||||
protected function _name($options = array(), $field = null, $key = 'name') {
|
||||
|
@ -2710,10 +2711,10 @@ class FormHelper extends AppHelper {
|
|||
/**
|
||||
* Returns an array of formatted OPTION/OPTGROUP elements
|
||||
*
|
||||
* @param array $elements
|
||||
* @param array $parents
|
||||
* @param boolean $showParents
|
||||
* @param array $attributes
|
||||
* @param array $elements Elements to format.
|
||||
* @param array $parents Parents for OPTGROUP.
|
||||
* @param boolean $showParents Whether to show parents.
|
||||
* @param array $attributes HTML attributes.
|
||||
* @return array
|
||||
*/
|
||||
protected function _selectOptions($elements = array(), $parents = array(), $showParents = null, $attributes = array()) {
|
||||
|
@ -2828,8 +2829,8 @@ class FormHelper extends AppHelper {
|
|||
/**
|
||||
* Generates option lists for common <select /> menus
|
||||
*
|
||||
* @param string $name
|
||||
* @param array $options
|
||||
* @param string $name List type name.
|
||||
* @param array $options Options list.
|
||||
* @return array
|
||||
*/
|
||||
protected function _generateOptions($name, $options = array()) {
|
||||
|
@ -3008,7 +3009,7 @@ class FormHelper extends AppHelper {
|
|||
/**
|
||||
* Sets the last created form action.
|
||||
*
|
||||
* @var mixed
|
||||
* @param string|array $url URL.
|
||||
* @return void
|
||||
*/
|
||||
protected function _lastAction($url) {
|
||||
|
@ -3022,7 +3023,7 @@ class FormHelper extends AppHelper {
|
|||
* Set/Get inputDefaults for form elements
|
||||
*
|
||||
* @param array $defaults New default values
|
||||
* @param boolean Merge with current defaults
|
||||
* @param boolean $merge Merge with current defaults
|
||||
* @return array inputDefaults
|
||||
*/
|
||||
public function inputDefaults($defaults = null, $merge = false) {
|
||||
|
|
|
@ -243,7 +243,7 @@ class JqueryEngineHelper extends JsBaseEngineHelper {
|
|||
*
|
||||
* If the 'update' key is set, success callback will be overridden.
|
||||
*
|
||||
* @param string|array $url
|
||||
* @param string|array $url URL
|
||||
* @param array $options See JsHelper::request() for options.
|
||||
* @return string The completed ajax call.
|
||||
* @see JsBaseEngineHelper::request() for options list.
|
||||
|
|
|
@ -138,6 +138,7 @@ abstract class JsBaseEngineHelper extends AppHelper {
|
|||
*
|
||||
* @param mixed $val A PHP variable to be converted to JSON
|
||||
* @param boolean $quoteString If false, leaves string values unquoted
|
||||
* @param string $key Key name.
|
||||
* @return string a JavaScript-safe/JSON representation of $val
|
||||
*/
|
||||
public function value($val = array(), $quoteString = null, $key = 'value') {
|
||||
|
|
|
@ -158,6 +158,7 @@ class JsHelper extends AppHelper {
|
|||
*
|
||||
* @param mixed $val A PHP variable to be converted to JSON
|
||||
* @param boolean $quoteString If false, leaves string values unquoted
|
||||
* @param string $key Key name.
|
||||
* @return string a JavaScript-safe/JSON representation of $val
|
||||
* @link http://book.cakephp.org/2.0/en/core-libraries/helpers/js.html#JsHelper::value
|
||||
*/
|
||||
|
|
|
@ -230,8 +230,8 @@ class MootoolsEngineHelper extends JsBaseEngineHelper {
|
|||
* Requires `Request`. If you wish to use 'update' key you must have ```Request.HTML```
|
||||
* if you wish to do Json requests you will need ```JSON``` and ```Request.JSON```.
|
||||
*
|
||||
* @param string|array $url
|
||||
* @param array $options
|
||||
* @param string|array $url URL
|
||||
* @param array $options Options list.
|
||||
* @return string The completed ajax call.
|
||||
*/
|
||||
public function request($url, $options = array()) {
|
||||
|
|
|
@ -67,6 +67,8 @@ class NumberHelper extends AppHelper {
|
|||
/**
|
||||
* Call methods from CakeNumber utility class
|
||||
*
|
||||
* @param string $method Method to call.
|
||||
* @param array $params Parameters to pass to method.
|
||||
* @return mixed Whatever is returned by called method, or false on failure
|
||||
*/
|
||||
public function __call($method, $params) {
|
||||
|
@ -76,11 +78,10 @@ class NumberHelper extends AppHelper {
|
|||
/**
|
||||
* Formats a number with a level of precision.
|
||||
*
|
||||
* @see CakeNumber::precision()
|
||||
*
|
||||
* @param float $number A floating point number.
|
||||
* @param integer $precision The precision of the returned number.
|
||||
* @return float Formatted float.
|
||||
* @see CakeNumber::precision()
|
||||
* @link http://book.cakephp.org/2.0/en/core-libraries/helpers/number.html#NumberHelper::precision
|
||||
*/
|
||||
public function precision($number, $precision = 3) {
|
||||
|
@ -90,10 +91,9 @@ class NumberHelper extends AppHelper {
|
|||
/**
|
||||
* Returns a formatted-for-humans file size.
|
||||
*
|
||||
* @see CakeNumber::toReadableSize()
|
||||
*
|
||||
* @param integer $size Size in bytes
|
||||
* @return string Human readable size
|
||||
* @see CakeNumber::toReadableSize()
|
||||
* @link http://book.cakephp.org/2.0/en/core-libraries/helpers/number.html#NumberHelper::toReadableSize
|
||||
*/
|
||||
public function toReadableSize($size) {
|
||||
|
@ -107,12 +107,11 @@ class NumberHelper extends AppHelper {
|
|||
*
|
||||
* - `multiply`: Multiply the input value by 100 for decimal percentages.
|
||||
*
|
||||
* @see CakeNumber::toPercentage()
|
||||
*
|
||||
* @param float $number A floating point number
|
||||
* @param integer $precision The precision of the returned number
|
||||
* @param array $options Options
|
||||
* @return string Percentage string
|
||||
* @see CakeNumber::toPercentage()
|
||||
* @link http://book.cakephp.org/2.0/en/core-libraries/helpers/number.html#NumberHelper::toPercentage
|
||||
*/
|
||||
public function toPercentage($number, $precision = 2, $options = array()) {
|
||||
|
@ -122,12 +121,11 @@ class NumberHelper extends AppHelper {
|
|||
/**
|
||||
* Formats a number into a currency format.
|
||||
*
|
||||
* @see CakeNumber::format()
|
||||
*
|
||||
* @param float $number A floating point number
|
||||
* @param integer $options If integer then places, if string then before, if (,.-) then use it
|
||||
* or array with places and before keys
|
||||
* @return string formatted number
|
||||
* @see CakeNumber::format()
|
||||
* @link http://book.cakephp.org/2.0/en/core-libraries/helpers/number.html#NumberHelper::format
|
||||
*/
|
||||
public function format($number, $options = false) {
|
||||
|
@ -137,14 +135,13 @@ class NumberHelper extends AppHelper {
|
|||
/**
|
||||
* Formats a number into a currency format.
|
||||
*
|
||||
* @see CakeNumber::currency()
|
||||
*
|
||||
* @param float $number
|
||||
* @param float $number Number to format.
|
||||
* @param string $currency Shortcut to default options. Valid values are 'USD', 'EUR', 'GBP', otherwise
|
||||
* set at least 'before' and 'after' options.
|
||||
* 'USD' is the default currency, use CakeNumber::defaultCurrency() to change this default.
|
||||
* @param array $options
|
||||
* @param array $options Options list.
|
||||
* @return string Number formatted as a currency.
|
||||
* @see CakeNumber::currency()
|
||||
* @link http://book.cakephp.org/2.0/en/core-libraries/helpers/number.html#NumberHelper::currency
|
||||
*/
|
||||
public function currency($number, $currency = null, $options = array()) {
|
||||
|
@ -164,11 +161,10 @@ class NumberHelper extends AppHelper {
|
|||
* Added formats are merged with the defaults defined in Cake\Utility\Number::$_currencyDefaults
|
||||
* See Cake\Utility\Number::currency() for more information on the various options and their function.
|
||||
*
|
||||
* @see CakeNumber::addFormat()
|
||||
*
|
||||
* @param string $formatName The format name to be used in the future.
|
||||
* @param array $options The array of options for this format.
|
||||
* @return void
|
||||
* @see CakeNumber::addFormat()
|
||||
* @link http://book.cakephp.org/2.0/en/core-libraries/helpers/number.html#NumberHelper::addFormat
|
||||
*/
|
||||
public function addFormat($formatName, $options) {
|
||||
|
@ -178,10 +174,9 @@ class NumberHelper extends AppHelper {
|
|||
/**
|
||||
* Getter/setter for default currency
|
||||
*
|
||||
* @see CakeNumber::defaultCurrency()
|
||||
*
|
||||
* @param string $currency The currency to be used in the future.
|
||||
* @return string Currency
|
||||
* @see CakeNumber::defaultCurrency()
|
||||
*/
|
||||
public function defaultCurrency($currency) {
|
||||
return $this->_engine->defaultCurrency($currency);
|
||||
|
|
|
@ -105,7 +105,7 @@ class PaginatorHelper extends AppHelper {
|
|||
/**
|
||||
* Before render callback. Overridden to merge passed args with URL options.
|
||||
*
|
||||
* @param string $viewFile
|
||||
* @param string $viewFile View file name.
|
||||
* @return void
|
||||
*/
|
||||
public function beforeRender($viewFile) {
|
||||
|
@ -454,7 +454,7 @@ class PaginatorHelper extends AppHelper {
|
|||
* Converts the keys being used into the format set by options.paramType
|
||||
*
|
||||
* @param array $url Array of URL params to convert
|
||||
* @param string $type
|
||||
* @param string $type Keys type.
|
||||
* @return array converted URL params.
|
||||
*/
|
||||
protected function _convertUrlKeys($url, $type) {
|
||||
|
@ -476,11 +476,11 @@ class PaginatorHelper extends AppHelper {
|
|||
/**
|
||||
* Protected method for generating prev/next links
|
||||
*
|
||||
* @param string $which
|
||||
* @param string $title
|
||||
* @param array $options
|
||||
* @param string $disabledTitle
|
||||
* @param array $disabledOptions
|
||||
* @param string $which Link type: 'Prev', 'Next'.
|
||||
* @param string $title Link title.
|
||||
* @param array $options Options list.
|
||||
* @param string $disabledTitle Disabled link title.
|
||||
* @param array $disabledOptions Disabled link options.
|
||||
* @return string
|
||||
*/
|
||||
protected function _pagingLink($which, $title = null, $options = array(), $disabledTitle = null, $disabledOptions = array()) {
|
||||
|
@ -621,6 +621,7 @@ class PaginatorHelper extends AppHelper {
|
|||
* - `separator` The separator string to use, default to ' of '
|
||||
*
|
||||
* The `%page%` style placeholders also work, but are deprecated and will be removed in a future version.
|
||||
*
|
||||
* @param array $options Options for the counter string. See #options for list of keys.
|
||||
* @return string Counter string.
|
||||
* @deprecated The %page% style placeholders are deprecated.
|
||||
|
|
|
@ -228,8 +228,8 @@ class PrototypeEngineHelper extends JsBaseEngineHelper {
|
|||
/**
|
||||
* Create an Ajax or Ajax.Updater call.
|
||||
*
|
||||
* @param string|array $url
|
||||
* @param array $options
|
||||
* @param string|array $url URL.
|
||||
* @param array $options Options list.
|
||||
* @return string The completed ajax call.
|
||||
*/
|
||||
public function request($url, $options = array()) {
|
||||
|
|
|
@ -97,7 +97,7 @@ class RssHelper extends AppHelper {
|
|||
* Returns an RSS document wrapped in `<rss />` tags
|
||||
*
|
||||
* @param array $attrib `<rss />` tag attributes
|
||||
* @param string $content
|
||||
* @param string $content Tag content.
|
||||
* @return string An RSS document
|
||||
* @link http://book.cakephp.org/2.0/en/core-libraries/helpers/rss.html#RssHelper::document
|
||||
*/
|
||||
|
@ -274,7 +274,7 @@ class RssHelper extends AppHelper {
|
|||
/**
|
||||
* Converts a time in any format to an RSS time
|
||||
*
|
||||
* @param integer|string|DateTime $time
|
||||
* @param integer|string|DateTime $time UNIX timestamp or valid time string or DateTime object.
|
||||
* @return string An RSS-formatted timestamp
|
||||
* @see TimeHelper::toRSS
|
||||
* @link http://book.cakephp.org/2.0/en/core-libraries/helpers/rss.html#RssHelper::time
|
||||
|
|
|
@ -48,7 +48,7 @@ class SessionHelper extends AppHelper {
|
|||
*
|
||||
* In your view: `$this->Session->check('Controller.sessKey');`
|
||||
*
|
||||
* @param string $name
|
||||
* @param string $name Session key to check.
|
||||
* @return boolean
|
||||
* @link http://book.cakephp.org/2.0/en/core-libraries/helpers/session.html#SessionHelper::check
|
||||
*/
|
||||
|
|
|
@ -81,6 +81,9 @@ class TextHelper extends AppHelper {
|
|||
|
||||
/**
|
||||
* Call methods from String utility class
|
||||
*
|
||||
* @param string $method Method to call.
|
||||
* @param array $params Parameters to pass to method.
|
||||
* @return mixed Whatever is returned by called method, or false on failure
|
||||
*/
|
||||
public function __call($method, $params) {
|
||||
|
@ -218,12 +221,11 @@ class TextHelper extends AppHelper {
|
|||
* Highlights a given phrase in a text. You can specify any expression in highlighter that
|
||||
* may include the \1 expression to include the $phrase found.
|
||||
*
|
||||
* @see String::highlight()
|
||||
*
|
||||
* @param string $text Text to search the phrase in
|
||||
* @param string $phrase The phrase that will be searched
|
||||
* @param array $options An array of html attributes and options.
|
||||
* @return string The highlighted text
|
||||
* @see String::highlight()
|
||||
* @link http://book.cakephp.org/2.0/en/core-libraries/helpers/text.html#TextHelper::highlight
|
||||
*/
|
||||
public function highlight($text, $phrase, $options = array()) {
|
||||
|
@ -256,10 +258,9 @@ class TextHelper extends AppHelper {
|
|||
/**
|
||||
* Strips given text of all links (<a href=....)
|
||||
*
|
||||
* @see String::stripLinks()
|
||||
*
|
||||
* @param string $text Text
|
||||
* @return string The text without links
|
||||
* @see String::stripLinks()
|
||||
* @link http://book.cakephp.org/2.0/en/core-libraries/helpers/text.html#TextHelper::stripLinks
|
||||
*/
|
||||
public function stripLinks($text) {
|
||||
|
@ -278,12 +279,11 @@ class TextHelper extends AppHelper {
|
|||
* - `exact` If false, $text will not be cut mid-word
|
||||
* - `html` If true, HTML tags would be handled correctly
|
||||
*
|
||||
* @see String::truncate()
|
||||
*
|
||||
* @param string $text String to truncate.
|
||||
* @param integer $length Length of returned string, including ellipsis.
|
||||
* @param array $options An array of html attributes and options.
|
||||
* @return string Trimmed string.
|
||||
* @see String::truncate()
|
||||
* @link http://book.cakephp.org/2.0/en/core-libraries/helpers/text.html#TextHelper::truncate
|
||||
*/
|
||||
public function truncate($text, $length = 100, $options = array()) {
|
||||
|
@ -301,12 +301,11 @@ class TextHelper extends AppHelper {
|
|||
* - `ellipsis` Will be used as Beginning and prepended to the trimmed string
|
||||
* - `exact` If false, $text will not be cut mid-word
|
||||
*
|
||||
* @see String::tail()
|
||||
*
|
||||
* @param string $text String to truncate.
|
||||
* @param integer $length Length of returned string, including ellipsis.
|
||||
* @param array $options An array of html attributes and options.
|
||||
* @return string Trimmed string.
|
||||
* @see String::tail()
|
||||
* @link http://book.cakephp.org/2.0/en/core-libraries/helpers/text.html#TextHelper::tail
|
||||
*/
|
||||
public function tail($text, $length = 100, $options = array()) {
|
||||
|
@ -317,13 +316,12 @@ class TextHelper extends AppHelper {
|
|||
* Extracts an excerpt from the text surrounding the phrase with a number of characters on each side
|
||||
* determined by radius.
|
||||
*
|
||||
* @see String::excerpt()
|
||||
*
|
||||
* @param string $text String to search the phrase in
|
||||
* @param string $phrase Phrase that will be searched for
|
||||
* @param integer $radius The amount of characters that will be returned on each side of the founded phrase
|
||||
* @param string $ending Ending that will be appended
|
||||
* @return string Modified string
|
||||
* @see String::excerpt()
|
||||
* @link http://book.cakephp.org/2.0/en/core-libraries/helpers/text.html#TextHelper::excerpt
|
||||
*/
|
||||
public function excerpt($text, $phrase, $radius = 100, $ending = '...') {
|
||||
|
@ -333,12 +331,11 @@ class TextHelper extends AppHelper {
|
|||
/**
|
||||
* Creates a comma separated list where the last two items are joined with 'and', forming natural English
|
||||
*
|
||||
* @see String::toList()
|
||||
*
|
||||
* @param array $list The list to be joined
|
||||
* @param string $and The word used to join the last and second last items together with. Defaults to 'and'
|
||||
* @param string $separator The separator used to join all the other items together. Defaults to ', '
|
||||
* @return string The glued together string.
|
||||
* @see String::toList()
|
||||
* @link http://book.cakephp.org/2.0/en/core-libraries/helpers/text.html#TextHelper::toList
|
||||
*/
|
||||
public function toList($list, $and = 'and', $separator = ', ') {
|
||||
|
|
|
@ -115,6 +115,9 @@ class TimeHelper extends AppHelper {
|
|||
|
||||
/**
|
||||
* Call methods from CakeTime utility class
|
||||
*
|
||||
* @param string $method Method to call.
|
||||
* @param array $params Parameters to pass to method.
|
||||
* @return mixed Whatever is returned by called method, or false on failure
|
||||
*/
|
||||
public function __call($method, $params) {
|
||||
|
@ -125,12 +128,11 @@ class TimeHelper extends AppHelper {
|
|||
* Converts a string representing the format for the function strftime and returns a
|
||||
* windows safe and i18n aware format.
|
||||
*
|
||||
* @see CakeTime::convertSpecifiers()
|
||||
*
|
||||
* @param string $format Format with specifiers for strftime function.
|
||||
* Accepts the special specifier %S which mimics the modifier S for date()
|
||||
* @param string $time UNIX timestamp
|
||||
* @return string windows safe and date() function compatible format for strftime
|
||||
* @see CakeTime::convertSpecifiers()
|
||||
* @link http://book.cakephp.org/2.0/en/core-libraries/helpers/time.html#formatting
|
||||
*/
|
||||
public function convertSpecifiers($format, $time = null) {
|
||||
|
@ -140,11 +142,10 @@ class TimeHelper extends AppHelper {
|
|||
/**
|
||||
* Converts given time (in server's time zone) to user's local time, given his/her timezone.
|
||||
*
|
||||
* @see CakeTime::convert()
|
||||
*
|
||||
* @param string $serverTime UNIX timestamp
|
||||
* @param string|DateTimeZone $timezone User's timezone string or DateTimeZone object
|
||||
* @return integer UNIX timestamp
|
||||
* @see CakeTime::convert()
|
||||
* @link http://book.cakephp.org/2.0/en/core-libraries/helpers/time.html#formatting
|
||||
*/
|
||||
public function convert($serverTime, $timezone) {
|
||||
|
@ -154,9 +155,8 @@ class TimeHelper extends AppHelper {
|
|||
/**
|
||||
* Returns server's offset
|
||||
*
|
||||
* @see CakeTime::serverOffset()
|
||||
*
|
||||
* @return integer Offset
|
||||
* @see CakeTime::serverOffset()
|
||||
* @link http://book.cakephp.org/2.0/en/core-libraries/helpers/time.html#formatting
|
||||
*/
|
||||
public function serverOffset() {
|
||||
|
@ -166,11 +166,10 @@ class TimeHelper extends AppHelper {
|
|||
/**
|
||||
* Returns a UNIX timestamp, given either a UNIX timestamp or a valid strtotime() date string.
|
||||
*
|
||||
* @see CakeTime::fromString()
|
||||
*
|
||||
* @param integer|string|DateTime $dateString UNIX timestamp, strtotime() valid string or DateTime object
|
||||
* @param string|DateTimeZone $timezone User's timezone string or DateTimeZone object
|
||||
* @return string Parsed timestamp
|
||||
* @see CakeTime::fromString()
|
||||
* @link http://book.cakephp.org/2.0/en/core-libraries/helpers/time.html#formatting
|
||||
*/
|
||||
public function fromString($dateString, $timezone = null) {
|
||||
|
@ -180,12 +179,11 @@ class TimeHelper extends AppHelper {
|
|||
/**
|
||||
* Returns a nicely formatted date string for given Datetime string.
|
||||
*
|
||||
* @see CakeTime::nice()
|
||||
*
|
||||
* @param integer|string|DateTime $dateString UNIX timestamp, strtotime() valid string or DateTime object
|
||||
* @param string|DateTimeZone $timezone User's timezone string or DateTimeZone object
|
||||
* @param string $format The format to use. If null, `CakeTime::$niceFormat` is used
|
||||
* @return string Formatted date string
|
||||
* @see CakeTime::nice()
|
||||
* @link http://book.cakephp.org/2.0/en/core-libraries/helpers/time.html#formatting
|
||||
*/
|
||||
public function nice($dateString = null, $timezone = null, $format = null) {
|
||||
|
@ -195,11 +193,10 @@ class TimeHelper extends AppHelper {
|
|||
/**
|
||||
* Returns a formatted descriptive date string for given datetime string.
|
||||
*
|
||||
* @see CakeTime::niceShort()
|
||||
*
|
||||
* @param integer|string|DateTime $dateString UNIX timestamp, strtotime() valid string or DateTime objectp
|
||||
* @param string|DateTimeZone $timezone User's timezone string or DateTimeZone object
|
||||
* @return string Described, relative date string
|
||||
* @see CakeTime::niceShort()
|
||||
* @link http://book.cakephp.org/2.0/en/core-libraries/helpers/time.html#formatting
|
||||
*/
|
||||
public function niceShort($dateString = null, $timezone = null) {
|
||||
|
@ -209,13 +206,12 @@ class TimeHelper extends AppHelper {
|
|||
/**
|
||||
* Returns a partial SQL string to search for all records between two dates.
|
||||
*
|
||||
* @see CakeTime::daysAsSql()
|
||||
*
|
||||
* @param integer|string|DateTime $begin UNIX timestamp, strtotime() valid string or DateTime object
|
||||
* @param integer|string|DateTime $end UNIX timestamp, strtotime() valid string or DateTime object
|
||||
* @param string $fieldName Name of database field to compare with
|
||||
* @param string|DateTimeZone $timezone User's timezone string or DateTimeZone object
|
||||
* @return string Partial SQL string.
|
||||
* @see CakeTime::daysAsSql()
|
||||
* @link http://book.cakephp.org/2.0/en/core-libraries/helpers/time.html#formatting
|
||||
*/
|
||||
public function daysAsSql($begin, $end, $fieldName, $timezone = null) {
|
||||
|
@ -226,12 +222,11 @@ class TimeHelper extends AppHelper {
|
|||
* Returns a partial SQL string to search for all records between two times
|
||||
* occurring on the same day.
|
||||
*
|
||||
* @see CakeTime::dayAsSql()
|
||||
*
|
||||
* @param integer|string|DateTime $dateString UNIX timestamp, strtotime() valid string or DateTime object
|
||||
* @param string $fieldName Name of database field to compare with
|
||||
* @param string|DateTimeZone $timezone User's timezone string or DateTimeZone object
|
||||
* @return string Partial SQL string.
|
||||
* @see CakeTime::dayAsSql()
|
||||
* @link http://book.cakephp.org/2.0/en/core-libraries/helpers/time.html#formatting
|
||||
*/
|
||||
public function dayAsSql($dateString, $fieldName, $timezone = null) {
|
||||
|
@ -241,11 +236,10 @@ class TimeHelper extends AppHelper {
|
|||
/**
|
||||
* Returns true if given datetime string is today.
|
||||
*
|
||||
* @see CakeTime::isToday()
|
||||
*
|
||||
* @param integer|string|DateTime $dateString UNIX timestamp, strtotime() valid string or DateTime object
|
||||
* @param string|DateTimeZone $timezone User's timezone string or DateTimeZone object
|
||||
* @return boolean True if datetime string is today
|
||||
* @see CakeTime::isToday()
|
||||
* @link http://book.cakephp.org/2.0/en/core-libraries/helpers/time.html#testing-time
|
||||
*/
|
||||
public function isToday($dateString, $timezone = null) {
|
||||
|
@ -255,11 +249,10 @@ class TimeHelper extends AppHelper {
|
|||
/**
|
||||
* Returns true if given datetime string is within this week.
|
||||
*
|
||||
* @see CakeTime::isThisWeek()
|
||||
*
|
||||
* @param integer|string|DateTime $dateString UNIX timestamp, strtotime() valid string or DateTime object
|
||||
* @param string|DateTimeZone $timezone User's timezone string or DateTimeZone object
|
||||
* @return boolean True if datetime string is within current week
|
||||
* @see CakeTime::isThisWeek()
|
||||
* @link http://book.cakephp.org/2.0/en/core-libraries/helpers/time.html#testing-time
|
||||
*/
|
||||
public function isThisWeek($dateString, $timezone = null) {
|
||||
|
@ -269,11 +262,10 @@ class TimeHelper extends AppHelper {
|
|||
/**
|
||||
* Returns true if given datetime string is within this month
|
||||
*
|
||||
* @see CakeTime::isThisMonth()
|
||||
*
|
||||
* @param integer|string|DateTime $dateString UNIX timestamp, strtotime() valid string or DateTime object
|
||||
* @param string|DateTimeZone $timezone User's timezone string or DateTimeZone object
|
||||
* @return boolean True if datetime string is within current month
|
||||
* @see CakeTime::isThisMonth()
|
||||
* @link http://book.cakephp.org/2.0/en/core-libraries/helpers/time.html#testing-time
|
||||
*/
|
||||
public function isThisMonth($dateString, $timezone = null) {
|
||||
|
@ -283,11 +275,10 @@ class TimeHelper extends AppHelper {
|
|||
/**
|
||||
* Returns true if given datetime string is within current year.
|
||||
*
|
||||
* @see CakeTime::isThisYear()
|
||||
*
|
||||
* @param integer|string|DateTime $dateString UNIX timestamp, strtotime() valid string or DateTime object
|
||||
* @param string|DateTimeZone $timezone User's timezone string or DateTimeZone object
|
||||
* @return boolean True if datetime string is within current year
|
||||
* @see CakeTime::isThisYear()
|
||||
* @link http://book.cakephp.org/2.0/en/core-libraries/helpers/time.html#testing-time
|
||||
*/
|
||||
public function isThisYear($dateString, $timezone = null) {
|
||||
|
@ -297,13 +288,11 @@ class TimeHelper extends AppHelper {
|
|||
/**
|
||||
* Returns true if given datetime string was yesterday.
|
||||
*
|
||||
* @see CakeTime::wasYesterday()
|
||||
*
|
||||
* @param integer|string|DateTime $dateString UNIX timestamp, strtotime() valid string or DateTime object
|
||||
* @param string|DateTimeZone $timezone User's timezone string or DateTimeZone object
|
||||
* @return boolean True if datetime string was yesterday
|
||||
* @see CakeTime::wasYesterday()
|
||||
* @link http://book.cakephp.org/2.0/en/core-libraries/helpers/time.html#testing-time
|
||||
*
|
||||
*/
|
||||
public function wasYesterday($dateString, $timezone = null) {
|
||||
return $this->_engine->wasYesterday($dateString, $timezone);
|
||||
|
@ -312,11 +301,10 @@ class TimeHelper extends AppHelper {
|
|||
/**
|
||||
* Returns true if given datetime string is tomorrow.
|
||||
*
|
||||
* @see CakeTime::isTomorrow()
|
||||
*
|
||||
* @param integer|string|DateTime $dateString UNIX timestamp, strtotime() valid string or DateTime object
|
||||
* @param string|DateTimeZone $timezone User's timezone string or DateTimeZone object
|
||||
* @return boolean True if datetime string was yesterday
|
||||
* @see CakeTime::isTomorrow()
|
||||
* @link http://book.cakephp.org/2.0/en/core-libraries/helpers/time.html#testing-time
|
||||
*/
|
||||
public function isTomorrow($dateString, $timezone = null) {
|
||||
|
@ -326,11 +314,10 @@ class TimeHelper extends AppHelper {
|
|||
/**
|
||||
* Returns the quarter
|
||||
*
|
||||
* @see CakeTime::toQuarter()
|
||||
*
|
||||
* @param integer|string|DateTime $dateString UNIX timestamp, strtotime() valid string or DateTime object
|
||||
* @param boolean $range if true returns a range in Y-m-d format
|
||||
* @return mixed 1, 2, 3, or 4 quarter of year or array if $range true
|
||||
* @see CakeTime::toQuarter()
|
||||
* @link http://book.cakephp.org/2.0/en/core-libraries/helpers/time.html#formatting
|
||||
*/
|
||||
public function toQuarter($dateString, $range = false) {
|
||||
|
@ -340,11 +327,10 @@ class TimeHelper extends AppHelper {
|
|||
/**
|
||||
* Returns a UNIX timestamp from a textual datetime description. Wrapper for PHP function strtotime().
|
||||
*
|
||||
* @see CakeTime::toUnix()
|
||||
*
|
||||
* @param integer|string|DateTime $dateString UNIX timestamp, strtotime() valid string or DateTime object
|
||||
* @param string|DateTimeZone $timezone User's timezone string or DateTimeZone object
|
||||
* @return integer Unix timestamp
|
||||
* @see CakeTime::toUnix()
|
||||
* @link http://book.cakephp.org/2.0/en/core-libraries/helpers/time.html#formatting
|
||||
*/
|
||||
public function toUnix($dateString, $timezone = null) {
|
||||
|
@ -354,11 +340,10 @@ class TimeHelper extends AppHelper {
|
|||
/**
|
||||
* Returns a date formatted for Atom RSS feeds.
|
||||
*
|
||||
* @see CakeTime::toAtom()
|
||||
*
|
||||
* @param integer|string|DateTime $dateString UNIX timestamp, strtotime() valid string or DateTime object
|
||||
* @param string|DateTimeZone $timezone User's timezone string or DateTimeZone object
|
||||
* @return string Formatted date string
|
||||
* @see CakeTime::toAtom()
|
||||
* @link http://book.cakephp.org/2.0/en/core-libraries/helpers/time.html#formatting
|
||||
*/
|
||||
public function toAtom($dateString, $timezone = null) {
|
||||
|
@ -368,11 +353,10 @@ class TimeHelper extends AppHelper {
|
|||
/**
|
||||
* Formats date for RSS feeds
|
||||
*
|
||||
* @see CakeTime::toRSS()
|
||||
*
|
||||
* @param integer|string|DateTime $dateString UNIX timestamp, strtotime() valid string or DateTime object
|
||||
* @param string|DateTimeZone $timezone User's timezone string or DateTimeZone object
|
||||
* @return string Formatted date string
|
||||
* @see CakeTime::toRSS()
|
||||
* @link http://book.cakephp.org/2.0/en/core-libraries/helpers/time.html#formatting
|
||||
*/
|
||||
public function toRSS($dateString, $timezone = null) {
|
||||
|
@ -382,8 +366,6 @@ class TimeHelper extends AppHelper {
|
|||
/**
|
||||
* Formats date for RSS feeds
|
||||
*
|
||||
* @see CakeTime::timeAgoInWords()
|
||||
*
|
||||
* ## Addition options
|
||||
*
|
||||
* - `element` - The element to wrap the formatted time in.
|
||||
|
@ -395,6 +377,7 @@ class TimeHelper extends AppHelper {
|
|||
* @param integer|string|DateTime $dateTime UNIX timestamp, strtotime() valid string or DateTime object
|
||||
* @param array $options Default format if timestamp is used in $dateString
|
||||
* @return string Relative time string.
|
||||
* @see CakeTime::timeAgoInWords()
|
||||
* @link http://book.cakephp.org/2.0/en/core-libraries/helpers/time.html#formatting
|
||||
*/
|
||||
public function timeAgoInWords($dateTime, $options = array()) {
|
||||
|
@ -431,13 +414,12 @@ class TimeHelper extends AppHelper {
|
|||
/**
|
||||
* Returns true if specified datetime was within the interval specified, else false.
|
||||
*
|
||||
* @see CakeTime::wasWithinLast()
|
||||
*
|
||||
* @param string|integer $timeInterval the numeric value with space then time type.
|
||||
* Example of valid types: 6 hours, 2 days, 1 minute.
|
||||
* @param integer|string|DateTime $dateString UNIX timestamp, strtotime() valid string or DateTime object
|
||||
* @param string|DateTimeZone $timezone User's timezone string or DateTimeZone object
|
||||
* @return boolean
|
||||
* @see CakeTime::wasWithinLast()
|
||||
* @link http://book.cakephp.org/2.0/en/core-libraries/helpers/time.html#testing-time
|
||||
*/
|
||||
public function wasWithinLast($timeInterval, $dateString, $timezone = null) {
|
||||
|
@ -447,13 +429,12 @@ class TimeHelper extends AppHelper {
|
|||
/**
|
||||
* Returns true if specified datetime is within the interval specified, else false.
|
||||
*
|
||||
* @see CakeTime::isWithinLast()
|
||||
*
|
||||
* @param string|integer $timeInterval the numeric value with space then time type.
|
||||
* Example of valid types: 6 hours, 2 days, 1 minute.
|
||||
* @param integer|string|DateTime $dateString UNIX timestamp, strtotime() valid string or DateTime object
|
||||
* @param string|DateTimeZone $timezone User's timezone string or DateTimeZone object
|
||||
* @return boolean
|
||||
* @see CakeTime::isWithinLast()
|
||||
* @link http://book.cakephp.org/2.0/en/core-libraries/helpers/time.html#testing-time
|
||||
*/
|
||||
public function isWithinNext($timeInterval, $dateString, $timezone = null) {
|
||||
|
@ -463,10 +444,9 @@ class TimeHelper extends AppHelper {
|
|||
/**
|
||||
* Returns gmt as a UNIX timestamp.
|
||||
*
|
||||
* @see CakeTime::gmt()
|
||||
*
|
||||
* @param integer|string|DateTime $string UNIX timestamp, strtotime() valid string or DateTime object
|
||||
* @return integer UNIX timestamp
|
||||
* @see CakeTime::gmt()
|
||||
* @link http://book.cakephp.org/2.0/en/core-libraries/helpers/time.html#formatting
|
||||
*/
|
||||
public function gmt($string = null) {
|
||||
|
@ -489,13 +469,12 @@ class TimeHelper extends AppHelper {
|
|||
* $this->Time->format('2012-02-15 23:01:01', '%c', 'N/A', 'America/New_York'); // converts passed date to timezone
|
||||
* }}}
|
||||
*
|
||||
* @see CakeTime::format()
|
||||
*
|
||||
* @param integer|string|DateTime $format date format string (or a UNIX timestamp, strtotime() valid string or DateTime object)
|
||||
* @param integer|string|DateTime $date UNIX timestamp, strtotime() valid string or DateTime object (or a date format string)
|
||||
* @param boolean $invalid flag to ignore results of fromString == false
|
||||
* @param string|DateTimeZone $timezone User's timezone string or DateTimeZone object
|
||||
* @return string Formatted date string
|
||||
* @see CakeTime::format()
|
||||
* @link http://book.cakephp.org/2.0/en/core-libraries/helpers/time.html#formatting
|
||||
*/
|
||||
public function format($format, $date = null, $invalid = false, $timezone = null) {
|
||||
|
@ -506,13 +485,12 @@ class TimeHelper extends AppHelper {
|
|||
* Returns a formatted date string, given either a UNIX timestamp or a valid strtotime() date string.
|
||||
* It takes into account the default date format for the current language if a LC_TIME file is used.
|
||||
*
|
||||
* @see CakeTime::i18nFormat()
|
||||
*
|
||||
* @param integer|string|DateTime $date UNIX timestamp, strtotime() valid string or DateTime object
|
||||
* @param string $format strftime format string.
|
||||
* @param boolean $invalid flag to ignore results of fromString == false
|
||||
* @param string|DateTimeZone $timezone User's timezone string or DateTimeZone object
|
||||
* @return string Formatted and translated date string
|
||||
* @see CakeTime::i18nFormat()
|
||||
* @link http://book.cakephp.org/2.0/en/core-libraries/helpers/time.html#formatting
|
||||
*/
|
||||
public function i18nFormat($date, $format = null, $invalid = false, $timezone = null) {
|
||||
|
|
|
@ -38,7 +38,7 @@ class HelperCollection extends ObjectCollection implements CakeEventListener {
|
|||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param View $view
|
||||
* @param View $view View instance.
|
||||
*/
|
||||
public function __construct(View $view) {
|
||||
$this->_View = $view;
|
||||
|
@ -184,8 +184,7 @@ class HelperCollection extends ObjectCollection implements CakeEventListener {
|
|||
* Any non-null value will modify the parameter index indicated.
|
||||
* Defaults to false.
|
||||
*
|
||||
*
|
||||
* @param string $callback|CakeEvent Method to fire on all the objects. Its assumed all the objects implement
|
||||
* @param string|CakeEvent $callback Method to fire on all the objects. Its assumed all the objects implement
|
||||
* the method you are calling. If an instance of CakeEvent is provided, then then Event name will parsed to
|
||||
* get the callback name. This is done by getting the last word after any dot in the event name
|
||||
* (eg. `Model.afterSave` event will trigger the `afterSave` callback)
|
||||
|
|
|
@ -63,7 +63,7 @@ class JsonView extends View {
|
|||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param Controller $controller
|
||||
* @param Controller $controller Controller instance.
|
||||
*/
|
||||
public function __construct(Controller $controller = null) {
|
||||
parent::__construct($controller);
|
||||
|
|
|
@ -935,7 +935,7 @@ class View extends Object {
|
|||
/**
|
||||
* Sandbox method to evaluate a template / view script in.
|
||||
*
|
||||
* @param string $viewFn Filename of the view
|
||||
* @param string $viewFile Filename of the view
|
||||
* @param array $dataForView Data to include in rendered view.
|
||||
* If empty the current View::$viewVars will be used.
|
||||
* @return string Rendered output
|
||||
|
|
|
@ -63,7 +63,7 @@ class XmlView extends View {
|
|||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param Controller $controller
|
||||
* @param Controller $controller Controller instance.
|
||||
*/
|
||||
public function __construct(Controller $controller = null) {
|
||||
parent::__construct($controller);
|
||||
|
|
Loading…
Reference in a new issue