Skip to content
Permalink
Browse files

Fix up typos and add doc blocks.

  • Loading branch information...
markstory authored and lorenzo committed Mar 26, 2016
1 parent 480a1f0 commit 6dc1b3f8b9a4e06cfac62ad39bc97a3a7e75f1a2
Showing with 8 additions and 2 deletions.
  1. +8 −2 tests/TestCase/Database/ExpressionTypeCastingIntegrationTest.php
@@ -22,6 +22,9 @@
use Cake\Datasource\ConnectionManager;
use Cake\TestSuite\TestCase;
/**
* Value object for testing mappings.
*/
class UuidValue
{
public $value;
@@ -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
{
@@ -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']
);
};

0 comments on commit 6dc1b3f

Please sign in to comment.
You can’t perform that action at this time.