Sets the last error found

@param mixed $obj optional object to extract error from

@return null
972917
public function setError($obj=null)
    {
        $obj = $obj ? $obj : $this->_con;
        if (!is_resource($obj)) {
            return;
        }
        $error = \oci_error($obj);
        if (!$error) {
            return null;
        }
        $this->_last_error = $error;
    }
748352
public function delete($obj){
        $key  = $this->getModel()->table() . '_' . $obj->{$this->getModel()->getPK()->identifier()};
        $this->getDriver()->remove($key);

        return $this->getModel()->delete($obj);
    }
1141064
public static function object_to_array($obj)
	{
		//$_arr = is_object($obj) ? get_object_vars($obj) : $obj;
		if(is_object($obj) || is_array($obj)){
			if(is_object($obj)){
				$_arr = get_object_vars($obj);
			}else{
				$_arr = $obj;
			}
			foreach ($_arr as $key => $val)
			{
				$val = (is_array($val) || is_object($val)) ? self::object_to_array($val) : $val;
				$arr[$key] = $val;
			}
			return $arr;
		}else{
			return $obj;
		}
		
	}
979029
public function initializeObject($obj)
    {
        if ($obj instanceof Proxy) {
            $obj->__load();

            return;
        }

        if ($obj instanceof PersistentCollection) {
            $obj->initialize();
        }
    }
1290321
public static void error(Object obj) {
		if (obj instanceof Throwable) {
			Throwable e = (Throwable) obj;
			error(e, e.getMessage());
		} else {
			error("{}", obj);
		}
	}
599160
private function setError($error)
    {
        $this->errors[] = $error;
        if ($this->do_debug >= 1) {
            echo '<pre>';
            foreach ($this->errors as $error) {
                print_r($error);
            }
            echo '</pre>';
        }
    }
766821
public static function checkLastError()
    {
        $error = json_last_error();

        if ($error == JSON_ERROR_NONE) {
            return;
        }

        $message = json_last_error_msg();

        throw new JsonException("JSON Error: " . $message, $error);
    }
688439
protected function isFatal($lastError)
    {
        return
            !is_null($lastError) &&
            in_array($lastError['type'], self::$fatalErrors, true) &&
            // don't log uncaught exceptions as they were handled by exceptionHandler()
            !(isset($lastError['message']) &&
              strpos($lastError['message'], 'Uncaught') === 0);
    }
671404
public function setError($error)
    {
        $this->ocorrenciaTipo = self::OCORRENCIA_ERRO;
        $this->error          = $error;

        return $this;
    }
1115534
protected function validate($obj): bool
    {
        $time  = \time();
        $resId = $this->genID($obj);

        if (!$meta = $this->getMeta($resId)) {
            $this->destroy($obj);
            return false;
        }

        // check max lifetime
        $lifetime = $this->maxLifetime * 60;
        if ($time - $meta['createAt'] >= $lifetime) {
            $this->destroy($obj);
            return false;
        }

        // if lost connection, reconnection it.
        if (!$obj->connected) {
            return $this->reconnection($obj);
        }

        return true;
    }
742427
private static function logObject( $obj )
	{
		$path = config('system.errors.save_dir');
		if ($path != null) {
			if (!is_dir($path)) {
				@mkdir($path, 0755);
			}
			$name = strftime(config('system.errors.file_name'));
			if($name != '' && @touch($path.DIRECTORY_SEPARATOR.$name)){
				@error_log(PHP_EOL . $obj . PHP_EOL, 3, $path.DIRECTORY_SEPARATOR.$name);
			} else {
				@error_log(PHP_EOL . $obj . PHP_EOL, 0);
			}
		}
	}
600568
protected function lastErrorWasFatal()
    {
        if ($this->lastException) {
            return true;
        }
        $error = error_get_last();
        return $error && ($error['type'] & self::$fatal_errors) != 0;
    }
682135
public function removeAll($obj = null)
    {
        if ($obj === null) {
            $this->removeAllExcept(new \SplObjectStorage);
        }
        parent::removeAll($obj);
    }
922948
public function setLastAttempt($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Tasks\V2\Attempt::class);
        $this->last_attempt = $var;

        return $this;
    }
339718
protected function lastJsonErrorMessage($error)
    {
        $errors = [
            JSON_ERROR_DEPTH          => 'Maximum stack depth exceeded',
            JSON_ERROR_STATE_MISMATCH => 'State mismatch (invalid or malformed JSON)',
            JSON_ERROR_CTRL_CHAR      => 'Control character error, possibly incorrectly encoded',
            JSON_ERROR_SYNTAX         => 'Syntax error',
            JSON_ERROR_UTF8           => 'Malformed UTF-8 characters, possibly incorrectly encoded',
        ];

        return isset($errors[$error]) ? $errors[$error] : 'Unknown error';
    }
1285136
public function setError($error)
  {
    if ( !($error instanceof Exception) && is_string($error) ){
      $error = new Exception($error);
    }
    
    array_push($this->errors, $error);
    
    return $this;
  }
7632
public function setLastUser($lastUser)
    {
        if (\is_object($lastUser)) {
            $this->lastUserObject = $lastUser;
            $this->lastUser       = $lastUser->getId();
        } else {
            $this->lastUserObject = null;
            $this->lastUser       = $lastUser;
        }

        return $this;
    }