Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
pquery
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Taddeüs Kroes
pquery
Commits
51ba7151
Commit
51ba7151
authored
Nov 05, 2011
by
Taddes Kroes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Commented 'array' plugin.
parent
eda99477
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
0 deletions
+24
-0
pquery.array.php
pquery.array.php
+24
-0
No files found.
pquery.array.php
View file @
51ba7151
...
...
@@ -9,20 +9,44 @@
* @todo Documentation
*/
class
pQueryArray
extends
pQuery
implements
pQueryExtension
{
/**
* Get the value of an array alement at the given index.
*
* @param int|string $index The index to get the element of.
* @returns mixed The array value at the given index if it exists, or NULL otherwise.
*/
function
get
(
$index
)
{
return
isset
(
$this
->
variable
[
$index
])
?
$this
->
variable
[
$index
]
:
null
;
}
/**
* Check if the array is empty.
*
* @returns bool Whether the array is empty.
*/
function
is_empty
()
{
return
!
$this
->
count
();
}
/**
* Reverse the array.
*
* @returns pQueryArray The current object.
*/
function
reverse
()
{
$this
->
variable
=
array_reverse
(
$this
->
variable
);
return
$this
;
}
/**
* Execute an existing array function on the array.
*
* @var $method string A (part of the) function name to execute.
* @var method $args Additional arguments to pass to the called function.
* @returns mixed Either the current object, or the return value
* of the called array function.
*/
function
__call
(
$method
,
$args
)
{
$function
=
'array_'
.
$method
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment