public function removeThis() { try { $clients = self::getList(array('limit' => 1000000, 'filter' => array('reseller_id' => $this->id))); foreach ($clients as $client) { $statusRemove = $client->removeThis(); // Something failed if ($statusRemove == false) { return false; } } // Instance was created so we have to remove customer data first if ($this->status == 1) { erLhcoreClassInstance::removeCustomer($this); } erLhcoreClassInstance::getSession()->delete($this); return true; } catch (Exception $e) { return false; } }