Last active
January 28, 2016 22:04
-
-
Save xiris/afefeb8f5d15be8ca858 to your computer and use it in GitHub Desktop.
Example how to DONT code
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 bbablabla .... | |
* ... | |
* .. | |
* | |
*/ | |
public function init( | |
$arg_user_id, | |
$arg_client_id | |
) { | |
$return = array(); | |
if( | |
empty($arg_user_id) || | |
empty($arg_client_id) | |
){ | |
//Error Block: invalid input to delete client | |
include_once CORE_PATH . '/Debug/Error.php'; | |
$error = Error::init(200005); | |
$return['errors'][] = $error; | |
return $return; | |
} | |
//update client info | |
include_once DAL_MYSQLI_PATH . '/Clients/DeleteClientDal.php'; | |
$objDeleteClientDal = new DeleteClientDal(); | |
$deleted = $objDeleteClientDal->delete( | |
$arg_user_id, | |
$arg_client_id | |
); | |
if(!$deleted){ | |
//Error Block: Failed to delete user's client | |
include_once CORE_PATH . '/Debug/Error.php'; | |
$error = Error::init(200006); | |
$return['errors'][] = $error; | |
return $return; | |
} | |
$return['clients'] = array(); | |
return $return; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment