Skip to content

Commit

Permalink
0.10.0 release!
Browse files Browse the repository at this point in the history
  • Loading branch information
philiplb committed Sep 18, 2016
1 parent 04b9678 commit c6f28b6
Show file tree
Hide file tree
Showing 111 changed files with 32,873 additions and 7 deletions.
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
CRUDlex Changelog
=================

## 0.10.0
## 0.11.0
Released: Upcoming

## 0.10.0
Released: 2016-09-18
- Added a new data type implementing a many-to-many relationship: many
- Switched to SemVer
- Added validation of the entity definition YAML file
Expand Down
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ CRUDlex is an easy to use, well documented and tested CRUD generator for Silex.

## Documentation

- [Documentation 0.10.0](http://philiplb.github.io/CRUDlex/docs/html/0.10.0/) (upcoming)
- [Documentation 0.11.0](http://philiplb.github.io/CRUDlex/docs/html/0.11.0/) (upcoming)
- [Documentation 0.10.0](http://philiplb.github.io/CRUDlex/docs/html/0.10.0/)
- [Documentation 0.9.10](http://philiplb.github.io/CRUDlex/docs/html/0.9.10/)

How to build the documentation:
Expand All @@ -34,15 +35,15 @@ care about notes in the changelog when upgrading.

```json
"require": {
"philiplb/crudlex": "0.9.10"
"philiplb/crudlex": "0.10.0"
}
```

### Bleeding Edge

```json
"require": {
"philiplb/crudlex": "0.10.x-dev"
"philiplb/crudlex": "0.11.x-dev"
}
```

Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
},
"extra": {
"branch-alias": {
"dev-master": "0.10.x-dev"
"dev-master": "0.11.x-dev"
}
}
}
4 changes: 2 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@
# built documents.
#
# The short X.Y version.
version = u'0.10.0'
version = u'0.11.0'
# The full version, including alpha/beta/rc tags.
release = u'0.10.0'
release = u'0.11.0'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
4 changes: 4 additions & 0 deletions docs/html/0.11.0/.buildinfo
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
config: 8889b1aac02412aa528c81d9143e77e9
tags: 645f666f9bcd5a90fca523b33c5a78b7
Binary file added docs/html/0.11.0/_images/01_List.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
294 changes: 294 additions & 0 deletions docs/html/0.11.0/_sources/api/AbstractData.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,294 @@
---------------------
CRUDlex\\AbstractData
---------------------

.. toctree::
:maxdepth: 1

MySQLData

.. php:namespace: CRUDlex

.. php:class:: AbstractData

The abstract class for reading and writing data.

.. php:const:: DELETION_SUCCESS

Return value on successful deletion.

.. php:const:: DELETION_FAILED_STILL_REFERENCED

Return value on failed deletion due to existing references.

.. php:const:: DELETION_FAILED_EVENT

Return value on failed deletion due to a failed before delete event.

.. php:attr:: definition

protected

Holds the {@see EntityDefinition} entity definition.

.. php:attr:: fileProcessor

protected

Holds the {@see FileProcessorInterface} file processor.

.. php:attr:: events

protected

Holds the events.

.. php:method:: doDelete(Entity $entity, $deleteCascade)

Performs the actual deletion.

:type $entity: Entity
:param $entity: the id of the entry to delete
:type $deleteCascade: boolean
:param $deleteCascade: whether to delete children and subchildren
:returns: integer true on successful deletion

.. php:method:: hydrate($row)

Creates an {@see Entity} from the raw data array with the field name
as keys and field values as values.

:type $row: array
:param $row: the array with the raw data
:returns: Entity the entity containing the array data then

.. php:method:: shouldExecuteEvents(Entity $entity, $moment, $action)

Executes the event chain of an entity.

:type $entity: Entity
:param $entity: the entity having the event chain to execute
:type $moment: string
:param $moment: the "moment" of the event, can be either "before" or "after"
:type $action: string
:param $action: the "action" of the event, can be either "create", "update" or "delete"
:returns: boolean true on successful execution of the full chain or false if it broke at any point (and stopped the execution)

.. php:method:: performOnFiles(Entity $entity, $entityName, $function)

Executes a function for each file field of this entity.

:type $entity: Entity
:param $entity: the just created entity
:type $entityName: string
:param $entityName: the name of the entity as this class here is not aware of it
:type $function: \Closure
:param $function: the function to perform, takes $entity, $entityName and $field as parameter

.. php:method:: enrichEntityWithMetaData($id, Entity $entity)

Enriches an entity with metadata:
id, version, created_at, updated_at

:type $id: mixed
:param $id: the id of the entity to enrich
:type $entity: Entity
:param $entity: the entity to enrich

.. php:method:: pushEvent($moment, $action, Closure $function)

Adds an event to fire for the given parameters. The event function must
have this signature:
function (Entity $entity)
and has to return true or false.
The events are executed one after another in the added order as long as
they return "true". The first event returning "false" will stop the
process.

:type $moment: string
:param $moment: the "moment" of the event, can be either "before" or "after"
:type $action: string
:param $action: the "action" of the event, can be either "create", "update" or "delete"
:type $function: Closure
:param $function: the event function to be called if set

.. php:method:: popEvent($moment, $action)

Removes and returns the latest event for the given parameters.

:type $moment: string
:param $moment: the "moment" of the event, can be either "before" or "after"
:type $action: string
:param $action: the "action" of the event, can be either "create", "update" or "delete"
:returns: \Closure|null the popped event or null if no event was available.

.. php:method:: get($id)

Gets the entity with the given id.

:type $id: string
:param $id: the id
:returns: Entity the entity belonging to the id or null if not existant

.. php:method:: listEntries($filter = [], $filterOperators = [], $skip = null, $amount = null, $sortField = null, $sortAscending = null)

Gets a list of entities fullfilling the given filter or all if no
selection was given.

:type $filter: array
:param $filter: the filter all resulting entities must fulfill, the keys as field names
:type $filterOperators: array
:param $filterOperators: the operators of the filter like "=" defining the full condition of the field
:type $skip: integer|null
:param $skip: if given and not null, it specifies the amount of rows to skip
:type $amount: integer|null
:param $amount: if given and not null, it specifies the maximum amount of rows to retrieve
:type $sortField: string|null
:param $sortField: if given and not null, it specifies the field to sort the entries
:type $sortAscending: boolean|null
:param $sortAscending: if given and not null, it specifies that the sort order is ascending, descending else
:returns: Entity[] the entities fulfilling the filter or all if no filter was given

.. php:method:: create(Entity $entity)

Persists the given entity as new entry in the datasource.

:type $entity: Entity
:param $entity: the entity to persist
:returns: boolean true on successful creation

.. php:method:: update(Entity $entity)

Updates an existing entry in the datasource having the same id.

:type $entity: Entity
:param $entity: the entity with the new data
:returns: void

.. php:method:: delete($entity)

Deletes an entry from the datasource.

:type $entity: Entity
:param $entity: the entity to delete
:returns: integer returns one of: - AbstractData::DELETION_SUCCESS -> successful deletion - AbstractData::DELETION_FAILED_STILL_REFERENCED -> failed deletion due to existing references - AbstractData::DELETION_FAILED_EVENT -> failed deletion due to a failed before delete event

.. php:method:: getIdToNameMap($entity, $nameField)

Gets ids and names of a table. Used for building up the dropdown box of
reference type fields for example.

:type $entity: string
:param $entity: the entity
:type $nameField: string
:param $nameField: the field defining the name of the rows
:returns: array an array with the ids as key and the names as values

.. php:method:: countBy($table, $params, $paramsOperators, $excludeDeleted)

Retrieves the amount of entities in the datasource fulfilling the given
parameters.

:type $table: string
:param $table: the table to count in
:type $params: array
:param $params: an array with the field names as keys and field values as values
:type $paramsOperators: array
:param $paramsOperators: the operators of the parameters like "=" defining the full condition of the field
:type $excludeDeleted: boolean
:param $excludeDeleted: false, if soft deleted entries in the datasource should be counted, too
:returns: integer the count fulfilling the given parameters

.. php:method:: fetchReferences($entities = null)

Adds the id and name of referenced entities to the given entities. Each
reference field is before the raw id of the referenced entity and after
the fetch, it's an array with the keys id and name.

:param $entities:
:returns: void

.. php:method:: hasManySet($field, $thatIds, $excludeId = null)

Checks whether a given set of ids is assigned to any entity exactly
like it is given (no subset, no superset).

:type $field: string
:param $field: the many field
:type $thatIds: array
:param $thatIds: the id set to check
:type $excludeId: string|null
:param $excludeId: one optional own id to exclude from the check
:returns: boolean true if the set of ids exists for an entity

.. php:method:: getDefinition()

Gets the {@see EntityDefinition} instance.

:returns: EntityDefinition the definition instance

.. php:method:: createEmpty()

Creates a new, empty entity instance having all fields prefilled with
null or the defined value in case of fixed fields.

:returns: Entity the newly created entity

.. php:method:: createFiles(Request $request, Entity $entity, $entityName)

Creates the uploaded files of a newly created entity.

:type $request: Request
:param $request: the HTTP request containing the file data
:type $entity: Entity
:param $entity: the just created entity
:type $entityName: string
:param $entityName: the name of the entity as this class here is not aware of it
:returns: boolean true if all before events passed

.. php:method:: updateFiles(Request $request, Entity $entity, $entityName)

Updates the uploaded files of an updated entity.

:type $request: Request
:param $request: the HTTP request containing the file data
:type $entity: Entity
:param $entity: the updated entity
:type $entityName: string
:param $entityName: the name of the entity as this class here is not aware of it
:returns: boolean true on successful update

.. php:method:: deleteFile(Entity $entity, $entityName, $field)

Deletes a specific file from an existing entity.

:type $entity: Entity
:param $entity: the entity to delete the file from
:type $entityName: string
:param $entityName: the name of the entity as this class here is not aware of it
:type $field: string
:param $field: the field of the entity containing the file to be deleted
:returns: boolean true on successful deletion

.. php:method:: deleteFiles(Entity $entity, $entityName)

Deletes all files of an existing entity.

:type $entity: Entity
:param $entity: the entity to delete the files from
:type $entityName: string
:param $entityName: the name of the entity as this class here is not aware of it
:returns: boolean true on successful deletion

.. php:method:: renderFile(Entity $entity, $entityName, $field)

Renders (outputs) a file of an entity. This includes setting headers
like the file size, mimetype and name, too.

:type $entity: Entity
:param $entity: the entity to render the file from
:type $entityName: string
:param $entityName: the name of the entity as this class here is not aware of it
:type $field: string
:param $field: the field of the entity containing the file to be rendered
:returns: Response the HTTP response, likely to be a streamed one
Loading

0 comments on commit c6f28b6

Please sign in to comment.