| 1 | <?php |
||
| 9 | abstract class AbstractAdapter |
||
| 10 | { |
||
| 11 | /** |
||
| 12 | * @type AbstractAdapter[] |
||
| 13 | */ |
||
| 14 | private static $_instance = array (); |
||
| 15 | |||
| 16 | /** |
||
| 17 | * @type FilesFixeds[] |
||
| 18 | */ |
||
| 19 | private $instanceFixedFile = array (); |
||
| 20 | |||
| 21 | /** |
||
| 22 | * @param \Classes\MakerFile $makerFile |
||
| 23 | * @param \Classes\Db\DbTable $dbTable |
||
| 24 | * |
||
| 25 | * @return array |
||
| 26 | */ |
||
| 27 | abstract public function parseRelation ( \Classes\MakerFile $makerFile , \Classes\Db\DbTable $dbTable ); |
||
| 28 | |||
| 29 | /** |
||
| 30 | * @type string nome do arquivo template |
||
| 31 | */ |
||
| 32 | protected $fileTpl; |
||
| 33 | |||
| 34 | /** |
||
| 35 | * @type string |
||
| 36 | */ |
||
| 37 | protected $pastName; |
||
| 38 | |||
| 39 | /** |
||
| 40 | * nome do arquivo template e nome das classes fixas |
||
| 41 | * |
||
| 42 | * @type string[][] |
||
| 43 | */ |
||
| 44 | protected $fileFixedData = array (); |
||
| 45 | |||
| 46 | /** |
||
| 47 | * @var bool |
||
| 48 | */ |
||
| 49 | protected $overwrite = false; |
||
| 50 | |||
| 51 | /** |
||
| 52 | * |
||
| 53 | */ |
||
| 54 | final private function __construct () |
||
| 57 | |||
| 58 | /** |
||
| 59 | * @return \Classes\AdapterMakerFile\AbstractAdapter |
||
| 60 | */ |
||
| 61 | public static function getInstance () |
||
| 71 | |||
| 72 | /** |
||
| 73 | * verifica se existe diretorio nesta makeFile |
||
| 74 | * |
||
| 75 | * @return bool |
||
| 76 | */ |
||
| 77 | public function hasDiretory () |
||
| 81 | |||
| 82 | /** |
||
| 83 | * @return \Classes\AdapterMakerFile\FilesFixeds |
||
| 84 | */ |
||
| 85 | public function getFilesFixeds ( $key ) |
||
| 100 | |||
| 101 | /** |
||
| 102 | * verifica se existe arquivo de exeção |
||
| 103 | * |
||
| 104 | * @return bool |
||
| 105 | */ |
||
| 106 | public function hasFilesFixeds ( $key ) |
||
| 110 | |||
| 111 | /** |
||
| 112 | * retorna a lista de possiveis objetos |
||
| 113 | * |
||
| 114 | * @return array |
||
| 115 | */ |
||
| 116 | public function getListFilesFixed () |
||
| 120 | |||
| 121 | /** |
||
| 122 | * @return string |
||
| 123 | */ |
||
| 124 | public function getFileTpl () |
||
| 128 | |||
| 129 | /** |
||
| 130 | * @return string |
||
| 131 | */ |
||
| 132 | public function getPastName () |
||
| 136 | |||
| 137 | /** |
||
| 138 | * @return bool |
||
| 139 | */ |
||
| 140 | public function isOverwrite () |
||
| 144 | |||
| 145 | } |
||
| 146 |
PHP has two types of connecting operators (logical operators, and boolean operators):
and&&or||The difference between these is the order in which they are executed. In most cases, you would want to use a boolean operator like
&&, or||.Let’s take a look at a few examples:
Logical Operators are used for Control-Flow
One case where you explicitly want to use logical operators is for control-flow such as this:
Since
dieintroduces problems of its own, f.e. it makes our code hardly testable, and prevents any kind of more sophisticated error handling; you probably do not want to use this in real-world code. Unfortunately, logical operators cannot be combined withthrowat this point:These limitations lead to logical operators rarely being of use in current PHP code.