123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475 |
- <?php
- namespace ZN\Foundations\Traits;
- trait ErrorControlTrait
- {
- /* Error Değişkeni
- *
- * Dosya işlemlerinde oluşan hata bilgilerini
- * tutması için oluşturulmuştur.
- *
- */
- protected $error;
-
- //----------------------------------------------------------------------------------------------------
- // Protected Success
- //----------------------------------------------------------------------------------------------------
- //
- // Oluşan başarı bilgisi
- //
- // @var string
- //
- //----------------------------------------------------------------------------------------------------
- protected $success;
-
- /******************************************************************************************
- * ERROR *
- *******************************************************************************************
- | Genel Kullanım: Dizin işlemlerinde oluşan hata bilgilerini tutması için oluşturulmuştur.|
- | |
- | Parametreler: Herhangi bir parametresi yoktur. |
- | |
- ******************************************************************************************/
- public function error()
- {
- if( isset($this->error) )
- {
- return $this->error;
- }
- elseif( $error = \Errors::get(str_ireplace(STATIC_ACCESS, '', __CLASS__)) )
- {
- return $error;
- }
- else
- {
- return false;
- }
- }
-
- //----------------------------------------------------------------------------------------------------
- // Success
- //----------------------------------------------------------------------------------------------------
- //
- // @param void
- // @return string
- //
- //----------------------------------------------------------------------------------------------------
- public function success()
- {
- if( empty($this->error) && ! \Errors::get(str_ireplace(STATIC_ACCESS, '', __CLASS__)) )
- {
- if( ! empty($this->success) )
- {
- return $this->success;
- }
- else
- {
- return lang('Success', 'success');
- }
- }
- else
- {
- return false;
- }
- }
- }
|