diff --git a/developer_manual/app/appframework/angular.rst b/developer_manual/app/appframework/angular.rst index 87107fad2..09e49987a 100644 --- a/developer_manual/app/appframework/angular.rst +++ b/developer_manual/app/appframework/angular.rst @@ -68,7 +68,7 @@ Simple object that can be used for displaying loading notifcations. It has an in Example: -.. code-block:: python +.. code-block:: js loading = new Loading() loading.isLoading() # false @@ -264,7 +264,7 @@ Because AngularJS getters have to be fast (Angular checks for changed objects af To query an object with a **_BiggerThanQuery** use its **get** method: -.. code-block:: python +.. code-block:: js valuesBiggerThan4 = myModel.get(new _BiggerThanQuery('id', 4)) @@ -284,7 +284,7 @@ You can override this method if you need to. The **exec** method is used to run A query that would select only ids between a range of numbers would look like this: -.. code-block:: python +.. code-block:: ruby angular.module('YourApp').factory '_LessThanQuery', ['_Query', (_Query) -> @@ -309,7 +309,7 @@ A query that would select only ids between a range of numbers would look like th If **hashCode** is not overwritten it would produce the following output: -.. code-block:: python +.. code-block:: ruby query = new _RangeQuery('id', 3, 6) query.hashCode() # prints range_id_3_6 @@ -330,10 +330,12 @@ Can be enhanced by passing an expression: { selector: '#jquery .selector' hideOnFocusLost: true + cssClass: 'opened' } * **selector**: if defined, a different area is slid up on click * **hideOnFocusLost**: if defined, the slid up area will hide when the focus is lost +* **cssClass**: if defined, the class which should be toggled on the element where the directive is bound to Example: @@ -342,6 +344,28 @@ Example:
+ +ocClickFocus +~~~~~~~~~~~~ +Can be used to focus a different element when the element is being clicked that has this directive + +Must pass an expression: + +.. code-block:: js + + { + selector: '#jquery .selector' + } + +* **selector**: the area that should be focused + +Example: + +.. code-block:: html + + + + ocDraggable ~~~~~~~~~~~ Shortcut for using jquery-ui draggable. The expression is passed to $.draggable. diff --git a/developer_manual/app/appframework/api/db_entity.rst b/developer_manual/app/appframework/api/db_entity.rst index e2512404a..3f5ab36ba 100644 --- a/developer_manual/app/appframework/api/db_entity.rst +++ b/developer_manual/app/appframework/api/db_entity.rst @@ -17,11 +17,6 @@ Entity - .. php:method:: __construct() - - - - .. php:method:: resetUpdatedFields() @@ -72,6 +67,17 @@ Entity + .. php:method:: addType($fieldName, $type) + + :param string $fieldName: the name of the attribute + :param string $type: the type which will be used to call settype() + + * **Protected** + + + Adds type information for a field so that its automatically casted tothat value once its being returned from the database + + .. php:method:: fromRow($row) :param array $row: the row to map onto the entity diff --git a/developer_manual/app/appframework/api/db_mapper.rst b/developer_manual/app/appframework/api/db_mapper.rst index 79eca44d7..8899a555b 100644 --- a/developer_manual/app/appframework/api/db_mapper.rst +++ b/developer_manual/app/appframework/api/db_mapper.rst @@ -47,6 +47,7 @@ may be subject to change in the future .. php:method:: update($entity) :param \\OCA\\AppFramework\\Db\\Entity $entity: + :throws \\InvalidArgumentException: if entity has no id Updates an entry in the db from an entity diff --git a/developer_manual/app/appframework/api/http_request.rst b/developer_manual/app/appframework/api/http_request.rst index 087b55919..26be8d1ac 100644 --- a/developer_manual/app/appframework/api/http_request.rst +++ b/developer_manual/app/appframework/api/http_request.rst @@ -11,10 +11,9 @@ Encapsulates $_GET, $_FILES and $_POST arrays for better testability - .. php:method:: __construct($get=array(), $post=array(), $files=array(), $server=array(), $env=array(), $session=array(), $cookie=array(), $urlParams=array()) + .. php:method:: __construct($params=array(), $files=array(), $server=array(), $env=array(), $session=array(), $cookie=array(), $urlParams=array()) - :param array $get: the $_GET array - :param array $post: the $_POST array + :param array $params: the parsed json array :param array $files: the $_FILES array :param array $server: the $_SERVER array :param array $env: the $_ENV array @@ -32,24 +31,14 @@ Encapsulates $_GET, $_FILES and $_POST arrays for better testability Returns the merged urlParams, GET and POST array - .. php:method:: getGET($key, $default=null) + .. php:method:: getParams($key, $default=null) :param string $key: the array key that should be looked up :param string $default: if the key is not found, return this value :returns mixed: the value of the stored array or the default - Returns the get value or the default if not found - - - .. php:method:: getPOST($key, $default=null) - - :param string $key: the array key that should be looked up - :param string $default: if the key is not found, return this value - :returns mixed: the value of the stored array or the default - - - Returns the get value or the default if not found + Returns the request params value or the default if not found .. php:method:: getFILES($key) diff --git a/developer_manual/app/appframework/api/utility_mappertestutility.rst b/developer_manual/app/appframework/api/utility_mappertestutility.rst index de4576fd1..6d4a321e8 100644 --- a/developer_manual/app/appframework/api/utility_mappertestutility.rst +++ b/developer_manual/app/appframework/api/utility_mappertestutility.rst @@ -40,3 +40,4 @@ Simple utility class for testing mappers Create mocks and set expected results for database queries + diff --git a/developer_manual/app/appframework/database.rst b/developer_manual/app/appframework/database.rst index 189cea0ad..b58d9250c 100644 --- a/developer_manual/app/appframework/database.rst +++ b/developer_manual/app/appframework/database.rst @@ -27,10 +27,19 @@ Getters and setters will automatically be created for all public attributes. Sho class Item extends Entity { - public $id; + // Note: a field id is set automatically by the parent class public $name; public $path; public $user; + public $timestamp; + + public function __construct(){ + // cast timestamp to an int when fromRow is being called + // the second parameter is the argument that is passed to + // the php function settype() + $this->addType('timestamp', 'int') + } + // transform username to lower case public function function setName($name){