Skip to content

Commit

Permalink
correcao
Browse files Browse the repository at this point in the history
  • Loading branch information
brunobmorais committed Mar 11, 2023
1 parent 8324b41 commit ed36516
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/Crud.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public function insert(string $fields, array $values = null, $debug = false)
foreach ($values as $item) { $numparams .= ",?"; }
$numparams = substr($numparams, 1);
$sql = "INSERT INTO {$this->tableName} ({$fields}) VALUES ({$numparams})";
if ($debug) { echo $sql; echo "<pre>"; print_r($values); echo "</pre>"; die(); }
if ($debug) { echo $sql; echo "<pre>"; print_r($values); echo "</pre>"; return; }
$result = $this->executeSQL($sql, $values);
if (empty($result))
return false;
Expand Down Expand Up @@ -121,7 +121,7 @@ public function update(string $fields, array $values = null, string $where = nul
$fields_T = substr($fields_T, 2);
$sql = "UPDATE {$this->tableName} SET {$fields_T}";
if (isset($where)) { $sql .= " WHERE $where"; }
if ($debug) { echo $sql; echo "<pre>"; print_r($values); echo "</pre>"; die(); }
if ($debug) { echo $sql; echo "<pre>"; print_r($values); echo "</pre>"; return; }
$result = $this->executeSQL($sql, $values);
if (empty($result))
return false;
Expand Down Expand Up @@ -188,7 +188,7 @@ public function delete(array $values = null, string $where = null, bool $debug =
{
$sql = "DELETE FROM {$this->tableName}";
if (!empty($where)) { $sql .= " WHERE $where"; }
if ($debug) { echo $sql; echo "<pre>"; print_r($values); echo "</pre>"; die(); }
if ($debug) { echo $sql; echo "<pre>"; print_r($values); echo "</pre>"; return; }
$result = $this->executeSQL($sql, $values);
if (empty($result))
return false;
Expand Down
8 changes: 5 additions & 3 deletions src/ModelAbstract.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,11 @@ function($p_0) use ($data)
}

/**
* @param
* @param $attribute
* @return string
*/
public function __get($attribute) {
public function __get($attribute):string
{
return $this->{$attribute}??"";
}

Expand All @@ -105,7 +106,8 @@ public function __get($attribute) {
* @param $value
* @return void
*/
public function __set($attribute, $value): void {
public function __set($attribute, $value): void
{
$this->{$attribute} = $value;
}
}

0 comments on commit ed36516

Please sign in to comment.