Download the PHP package chocofamilyme/restapi-helpers without Composer
On this page you can find all versions of the php package chocofamilyme/restapi-helpers. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download chocofamilyme/restapi-helpers
More information about chocofamilyme/restapi-helpers
Files in chocofamilyme/restapi-helpers
Download chocofamilyme/restapi-helpers
More information about chocofamilyme/restapi-helpers
Files in chocofamilyme/restapi-helpers
Vendor chocofamilyme
Package restapi-helpers
Short Description Вспомогательные функции и классы для проекта RestAPI
License BSD-3-Clause
Homepage https://github.com/chocofamilyme/restapi-helpers
Package restapi-helpers
Short Description Вспомогательные функции и классы для проекта RestAPI
License BSD-3-Clause
Homepage https://github.com/chocofamilyme/restapi-helpers
Please rate this library. Is it a good library?
Informations about the package restapi-helpers
Функции и классы помощники для проекта RestAPI
Внимание начиная с версии 2.x "глобальная" функция коллекции "collect" была перемеинована в "pcollect"
Требуется
- Phalcon > 3.0.0
- RestAPI
Коллекции
Коллекции принимают как параметр массив.
Cоздание
Есть два способа создания коллекции
-
Через helper pсollect, пример:
- Через класс
Методы
На данный момент у коллекции доступны следующий список методов:
first()
- Возвращает первый атрибут коллекцииlast()
- Возвращает последний атрибут коллекцииkey()
- возвращает индекс текущего атрибута коллекции.next()
- Возвращает следующий после текущего атрибута коллекцииcurrent()
- Возвращает текущий атрибут коллекцииall()
- Возвращает все атрибуты коллекции в виде массиваmap()
- Обертка над функцией array_mapmapWithKeys()
- Аналог метода mapwithkeys c Laravelfilter()
- Обертка над функцией array-filterreduce()
- Обертка над функцией array_reducediff()
- Обертка над функцией array_diffdiffUsing()
- Обертка над функцией array_udiffdiffAssoc()
- Обертка над функцией array_diff_assocdiffAssocUsing()
- Обертка над функцией array_diff_assoc -diffKeys()
- Обертка над функцией array_diff_keydiffKeysUsing()
- Обертка над функцией array_diff_ukeyeach()
- Аналог метода each с Laravelwhen()
- Аналог метода when с Laravelflip()
- Обертка над функцией array_flipsplice()
- Аналог метода splice с Laravelmerge()
- Обертка над функцией array_mergecombine()
- Обертка над функцией array_combinepartition()
- Аналог метода partition с Laravelreverse()
- Обертка над функцией array_reverseintersect()
- Обертка над функцией array_intersectintersectByKeys()
- Обертка над функцией array_intersect_keypad()
- Обертка над функцией array_padslice()
- Обертка над функцией array_slicechunk()
- Аналог метода chunk с Laravelexists()
- Принимает как параметр callback, и возвращает true false в зависимости от условииvalues()
- Обертка над функцией array_valueskeys()
- Обертка над функцией array_keysadd()
- Добавляет новый атрибут к коллекцииremove()
- Удаляет атрибут по ключуpush()
- Аналог метода push с Laravelsort()
- Аналог метода sort с Laravel
Модели
В модели доступны все методы коллекции.
На данный момент в моделях можно указать:
- свойство
fillable
- список элементов для массового заполнения - cвойство
required
- список обязательных элементов для заполненения (в случае отсутствии элементов из списка required выкидывается exceptionMissingRequiredException
)
Пример
All versions of restapi-helpers with dependencies
PHP Build Version
Package Version
Requires
php Version
>= 7.0.0
ext-phalcon Version >= 3.0.0
ext-phalcon Version >= 3.0.0
The package chocofamilyme/restapi-helpers contains the following files
Loading the files please wait ....