This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git flow feature finish $( git flow feature list | sed 's/^* //g' ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Generic\Model; | |
use Zend\Db\Sql\Predicate\Predicate; | |
use Zend\Db\TableGateway\TableGateway; | |
use Zend\Db\Sql\Select; | |
class GenericTable | |
{ | |
protected $tableGateway; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Generic\Model; | |
use Zend\Db\TableGateway\TableGateway; | |
use Zend\Db\Sql\Select; | |
class GenericTable | |
{ | |
protected $tableGateway; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Here's the function call. | |
* $searchCriteria is an instance of \Zend\InputFilter\InputFilter | |
*/ | |
$select->where->greaterThanOrEqualTo( | |
"EventDate", new \Zend\Db\Sql\Expression( | |
"STR_TO_DATE('" . $searchCriteria->getValue("startDate") ."','%m-%d-%Y')" | |
) | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace MaltBlue\Model; | |
use Zend\Db\TableGateway\TableGateway; | |
use Zend\Db\Sql\Select; | |
class CountryDebtTable extends QuickSearchTable | |
{ | |
protected $tableGateway; | |
public function __construct(TableGateway $tableGateway) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace MaltBlue\Model; | |
use Zend\InputFilter\Factory as InputFactory; | |
use Zend\InputFilter\InputFilter; | |
use Zend\InputFilter\InputFilterAwareInterface; | |
use Zend\InputFilter\InputFilterInterface; | |
use MaltBlue\Filter\Float; | |
class CountryDebt implements InputFilterAwareInterface | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function getServiceConfig() | |
{ | |
return array( | |
'CountryDebtTableGateway' => function ($sm) { | |
$dbAdapter = $sm->get('Zend\Db\Adapter\Adapter'); | |
$hydrator = new \MaltBlue\Hydrator\TableEntityMapper(array( | |
'CountryID' => 'countryId', | |
'DebtId' => 'debtId', | |
'DebtLevel' => 'debtLevel', | |
)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* First construct the Select object for the SQL query to run | |
*/ | |
$select = new Select('tblusers'); | |
$select->columns(array( | |
"recordCount" => new \Zend\Db\Sql\Expression("COUNT(*)") | |
)); | |
/** | |
* Then execute the query, retrieving the first record, if available |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace MyApplication\Form; | |
use Zend\Form\Annotation; | |
/** | |
* @Annotation\Name("user") | |
* @Annotation\Hydrator("Zend\Stdlib\Hydrator\ObjectProperty") | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$this->insert | |
->into('foo') | |
->columns(['col1', 'col2', 'col3']) | |
->values(['val1', 'val2', 'val3']); | |
$this->assertEquals( | |
'INSERT INTO foo ("col1", "col2", "col3") VALUES("val1", "val2", "val3")', | |
$this->insert->getSqlString(new TrustingSql92Platform()) | |
); |