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
server { | |
listen 80; | |
server_name owncloud.app | |
return 301 https://$server_name$request_uri; # enforce https | |
} | |
server { | |
listen 443 ssl; | |
server_name owncloud.app; | |
root /home/vagrant/owncloud; |
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 | |
/** | |
* Define the custom form element | |
*/ | |
namespace Forecaster\Form\Element; | |
use Zend\Form\Element\Select; | |
use Zend\InputFilter\InputProviderInterface; | |
use Zend\Validator\Db\RecordExists; | |
use Zend\ServiceManager\ServiceLocatorAwareInterface; |
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
// IndexControllerFactory.php | |
namespace YourModule\Controller\Factory; | |
use Zend\ServiceManager\FactoryInterface, | |
Zend\ServiceManager\ServiceLocatorInterface, | |
Zend\ServiceManager\Exception\ServiceNotCreatedException, | |
YourModule\Controller\IndexController; | |
class IndexControllerFactory implements FactoryInterface | |
{ |
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
return array( | |
'router' => array( | |
'routes' => array( | |
'forecaster' => array( | |
'type' => 'Literal', | |
'options' => array( | |
'route' => '/forecaster', | |
'defaults' => array( | |
'__NAMESPACE__' => 'Forecaster\Controller', | |
'controller' => 'Forecaster', |
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
/** | |
* 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
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
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
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
/* | |
* 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')" | |
) | |
); |