Skip to content

Commit

Permalink
Fix up typos and add doc blocks.
Browse files Browse the repository at this point in the history
  • Loading branch information
markstory authored and lorenzo committed Mar 26, 2016
1 parent 480a1f0 commit 6dc1b3f
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions tests/TestCase/Database/ExpressionTypeCastingIntegrationTest.php
Expand Up @@ -22,6 +22,9 @@
use Cake\Datasource\ConnectionManager;
use Cake\TestSuite\TestCase;

/**
* Value object for testing mappings.
*/
class UuidValue
{
public $value;
Expand All @@ -32,6 +35,9 @@ public function __construct($value)
}
}

/**
* Custom type class that maps between value objects, and SQL expressions.
*/
class OrderedUuidType extends Type implements ExpressionTypeInterface
{

Expand All @@ -42,10 +48,10 @@ public function toPHP($value, Driver $d)

public function toExpression($value)
{
$substr = function ($start, $lenght = null) use ($value) {
$substr = function ($start, $length = null) use ($value) {
return new FunctionExpression(
'SUBSTR',
$lenght === null ? [$value, $start] : [$value, $start, $lenght],
$length === null ? [$value, $start] : [$value, $start, $length],
['string', 'integer', 'integer']
);
};
Expand Down

0 comments on commit 6dc1b3f

Please sign in to comment.