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 | |
class Step extends AppModel | |
{ | |
public $belongsTo = ["Translator"]; | |
} | |
$results = model(Step::class)->find("first", [ | |
"conditions" => [ | |
"Step.translator_id IS NOT NULL", |
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
LSP: "Objects in a program should be replaceable with instances of their subtypes without altering the correctness of that program." | |
<?php | |
namespace App\User; | |
// imagine the following interface | |
interface Repository | |
{ | |
public function getById($id); |
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
function composer() | |
{ | |
COMPOSER="$(which composer)" | |
sed -i -e 's/zend_extension=C:\\php5.6\\ext\\php_xdebug-2.3.2-5.6-vc11-nts.dll/;zend_extension=C:\\php5.6\\ext\\php_xdebug-2.3.2-5.6-vc11-nts.dll/g' /c/php5.6/php.ini | |
$COMPOSER "$@" | |
sed -i -e 's/;zend_extension=C:\\php5.6\\ext\\php_xdebug-2.3.2-5.6-vc11-nts.dll/zend_extension=C:\\php5.6\\ext\\php_xdebug-2.3.2-5.6-vc11-nts.dll/g' /c/php5.6/php.ini | |
} |
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
//Add to app/Model/AppModel.php | |
public function updateAll($fields, $conditions = true) | |
{ | |
$fields = array_map([$this, "quoteString"], $fields); | |
if (is_array($conditions)) { | |
$conditions = array_map([$this, "quoteString"], $conditions); | |
} | |
parent::updateAll($fields, $conditions); | |
} |
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
javascript: | |
var amountBK = prompt('Enter amount',''); | |
void(document.getElementById('amount').value = amountBK); | |
void(document.getElementById('title').value = 'costs_description'); | |
void(document.getElementById('office').value = '123'); | |
void(document.getElementById('department').value = '12345'); | |
void(document.getElementById('account').value = '1234567'); | |
if (amountBK > 0) { | |
var blurEvent = new Event('blur'); | |
void(document.getElementById('amount').dispatchEvent(blurEvent)); |