Overview

Packages

  • Pinoco
    • PAL

Classes

  • Pinoco
  • Pinoco_Delegate
  • Pinoco_DynamicVars
  • Pinoco_HttpRequestVars
  • Pinoco_List
  • Pinoco_MIMEType
  • Pinoco_NativeRenderer
  • Pinoco_NothingVars
  • Pinoco_NullRenderer
  • Pinoco_OptionalParam
  • Pinoco_Pagination
  • Pinoco_PDOStatementWrapper
  • Pinoco_PDOWrapper
  • Pinoco_Renderer
  • Pinoco_Router
  • Pinoco_TALRenderer
  • Pinoco_TestEnvironment
  • Pinoco_Validator
  • Pinoco_ValidatorContext
  • Pinoco_Vars

Interfaces

  • Pinoco_ArrayConvertible

Functions

  • __pinoco_autoload_impl
  • Overview
  • Package
  • Class
  • Tree

Class Pinoco_List

List model

Pinoco_List implements IteratorAggregate, ArrayAccess, Countable, Pinoco_ArrayConvertible
Package: Pinoco
Copyright: Copyright 2010-2012, Hisateru Tanaka <tanakahisateru@gmail.com>
License: License (http://www.opensource.org/licenses/mit-license.php)
Author: Hisateru Tanaka <tanakahisateru@gmail.com>
Located at Pinoco/List.php
Methods summary
public
# __construct( )

Constructor to make an empty instance.

Constructor to make an empty instance.

public static Pinoco_List
# fromArray( mixed $src )

Makes a new object from Array.

Makes a new object from Array.

Parameters

$src
mixed
$src

Returns

Pinoco_List

Implementation of

Pinoco_ArrayConvertible::fromArray()
public static Pinoco_List
# wrap( array & $srcref )

Wraps an existing Array.

Wraps an existing Array.

Parameters

$srcref
array
&$srcref

Returns

Pinoco_List

Throws

InvalidArgumentException

Implementation of

Pinoco_ArrayConvertible::wrap()
public
# push( mixed $value,… )

Appends a value to tail.

Appends a value to tail.

Parameters

$value,…
mixed
$value,...
public mixed
# pop( )

Removes and return a value from tail.

Removes and return a value from tail.

Returns

mixed
public
# unshift( mixed $value,… )

Inserts a value to head.

Inserts a value to head.

Parameters

$value,…
mixed
$value,...
public mixed
# shift( )

Removes and return a value from head.

Removes and return a value from head.

Returns

mixed
public
# concat( mixed $source,… )

Concatenates another iterative object.

Concatenates another iterative object.

Parameters

$source,…
mixed
$source,...
public
# sort( callable $callable = null )

Sorts this list.

Sorts this list.

Parameters

$callable
callable
$callable
public Pinoco_List
# sorted( callable $callable = null )

Returns sorted list.

Returns sorted list.

Parameters

$callable
callable
$callable

Returns

Pinoco_List
public integer
# count( )

Returns a number of element of this list.

Returns a number of element of this list.

Returns

integer

Implementation of

Countable::count()
public string
# join( string $sep = "," )

Converts this list to string.

Converts this list to string.

Parameters

$sep
string
$sep

Returns

string
public Pinoco_List
# reverse( )

Returns a reversed list.

Returns a reversed list.

Returns

Pinoco_List
public Pinoco_List
# slice( integer $offset, integer $length = null )

Returns a slice.

Returns a slice.

Parameters

$offset
integer
$offset
$length
integer
$length

Returns

Pinoco_List
public Pinoco_List;
# splice( integer $offset, integer $length = null, array $replacement = null )

Removes elements by range and inserts another.

Removes elements by range and inserts another.

Parameters

$offset
integer
$offset
$length
integer
$length
$replacement
array
$replacement

Returns

Pinoco_List;
public
# insert( integer $offset, mixed $value,… )

Inserts another.

Inserts another.

Parameters

$offset
integer
$offset
$value,…
mixed
$value,...
public
# remove( integer $offset, integer $length = 1 )

Removes by range.

Removes by range.

Parameters

$offset
integer
$offset
$length
integer
$length
public integer
# index( mixed $value )

Returns the first position where value found in this list.

Returns the first position where value found in this list.

Parameters

$value
mixed
$value

Returns

integer
public mixed
# get( integer $idx, mixed $default = Pinoco_OptionalParam::UNSPECIFIED )

Returns value or default by position.

Returns value or default by position.

Parameters

$idx
integer
$idx
$default
mixed
$default

Returns

mixed

Implementation of

Pinoco_ArrayConvertible::get()
public mixed
# rget( string $expression, mixed $default = Pinoco_OptionalParam::UNSPECIFIED )

Returns a value or default by tree expression.

Returns a value or default by tree expression.

Parameters

$expression
string
$expression
$default
mixed
$default

Returns

mixed

Implementation of

Pinoco_ArrayConvertible::rget()
public
# set( integer $idx, mixed $value, mixed $default = Pinoco_OptionalParam::UNSPECIFIED )

Sets value by position.

Sets value by position.

Parameters

$idx
integer
$idx
$value
mixed
$value
$default
mixed
$default
public
# setDefault( mixed $value )

Sets a default value for overflow access.

Sets a default value for overflow access.

Parameters

$value
mixed
$value
public array
# toArray( array $modifier = null )

Exports elements to Array.

Exports elements to Array.

Parameters

$modifier
array
$modifier

Returns

array

Implementation of

Pinoco_ArrayConvertible::toArray()
public array
# toArrayRecurse( integer $depth = null )

Exports properties to Array recursively.

Exports properties to Array recursively.

Parameters

$depth
integer
$depth

Returns

array

Implementation of

Pinoco_ArrayConvertible::toArrayRecurse()
public mixed
# reduce( callable $callable, mixed $initial = null )

Fold operation for each elements.

Fold operation for each elements.

Parameters

$callable
callable
$callable
$initial
mixed
$initial

Returns

mixed
public
# each( callable $callable )

Some operation for each elements.

Some operation for each elements.

Parameters

$callable
callable
$callable
public Pinoco_List
# map( callable $callable )

Regenerates list from this list which elements are applied given function.

Regenerates list from this list which elements are applied given function.

Parameters

$callable
callable
$callable

Returns

Pinoco_List
public Pinoco_List
# filter( callable $callable )

Regenerates list from this list which elements are filtered by given function.

Regenerates list from this list which elements are filtered by given function.

Parameters

$callable
callable
$callable

Returns

Pinoco_List
public
# offsetSet( mixed $offset, mixed $value )

Implementation of

ArrayAccess::offsetSet()
public
# offsetExists( mixed $offset )

Implementation of

ArrayAccess::offsetExists()
public
# offsetUnset( mixed $offset )

Implementation of

ArrayAccess::offsetUnset()
public
# offsetGet( mixed $offset )

Implementation of

ArrayAccess::offsetGet()
public
# getIterator( )

Implementation of

IteratorAggregate::getIterator()
public
# __toString( )
Pinoco 0.8.0 Documentation API documentation generated by ApiGen 2.8.0