Guide showing you PHP and RPG differences
- RPG is strongly typed.
- RPG indexes start at 1, where PHP starts at 0.
- Variables in PHP start with a Dollar sign. ($)
Class CustomerRepository | |
{ | |
private $customerTable; | |
private $customerMapper; | |
public function __construct(CustomerTable $customerTable, CustomerMapper $customerMapper) | |
{ | |
$this->customerTable = $customerTable; | |
$this->CustomerMapper = $customerMapper; | |
} |
<?php | |
namespace RPG\Service\Factory; | |
use Zend\ServiceManager\FactoryInterface; | |
use Zend\ServiceManager\ServiceLocatorInterface; | |
use ToolkitApi\Toolkit; | |
/** | |
* Class ToolkitFactory | |
* @package RPG\Service\Factory | |
*/ |
<?php | |
namespace Load\Service\Query; | |
use Load\Infrastructure\Persistence\LoadTable; | |
use ServiceBus\Query\QueryHandlerInterface; | |
use Zend\Db\Sql\Predicate\Operator; | |
use Zend\Db\Sql\Select; | |
/** | |
* Class FetchAllUnpaidLoadsQueryHandler |
<?php | |
call_user_func(function () { | |
$phpBinary = '/usr/local/zendsvr6/bin/php-cli'; | |
$baseDirectory = getenv('ZS_APPLICATION_BASE_DIR'); | |
$migrationLogFile = getenv('ZS_MIGRATION_LOG_FILE'); | |
//foreach (['migrations:migrate', 'orm:generate-proxies', 'app:clear-cache'] as $operation) { | |
foreach (['migrations:migrate', 'app:clear-cache'] as $operation) { | |
$command = sprintf( |
<?php | |
namespace Application; | |
use ToolkitApi\Toolkit; | |
/** | |
* Class IbmiToolkitAdapter | |
* @package Application | |
*/ | |
class IbmiToolkitAdapter extends Toolkit implements IbmiToolkitInterface |
<?php | |
class GeneratePdfController extends AbstractActionController | |
{ | |
public function indexAction() | |
{ | |
$filename = '/path/to/myFile.pdf'; | |
$response = new Stream(); | |
$headers = new Headers(); | |
$headers | |
->addHeaderLine('Pragma', 'public') |
$(document).ready(function(){ | |
$('#mySelect2').select2('open') | |
}); |
$(document).ready(function() { | |
$('#mySelect2').select2({ | |
// properties | |
}).on('change', function (e, added) { | |
// If an option has been selected | |
if (e.val !== '') { | |
} | |
}); | |
}); |
var SearchTestReports = (function () { | |
var changeProductGroup = function (event) { | |
_getItemCodesByProductGroup(event.target.value).done(function (response) { | |
// populate item code select box | |
}; | |
}; | |
var _getItemCodesByProductGroup = function (productGroup) { | |
return $.ajax({ |