original_string: protected function deleteExpiredRecords()
      {
          try {
              $limit = (int)($this->limitDuration);
          } catch (\Exception $ex) {
              Yii::error($ex->getMessage(), __METHOD__);
              return 0;
          }
          $count = 0;
          $host = $this->host;
          /* @var $host \rhosocial\user\User */
          foreach (static::find()
                  ->createdBy($host)
                  ->andWhere(['<=', $this->createdAtAttribute, $this->offsetDatetime($this->currentUtcDatetime(), -$limit)])
                  ->all() as $login) {
              /* @var $login static */
              $result = $login->delete();
              $count += $result;
              if (YII_ENV_DEV) {
                  Yii::info($host->getReadableGUID() . ": ($result) login record created at (" . $login->getCreatedAt() . ") was just deleted.", __METHOD__);
              }
          }
          return $count;
      }
code: protected function deleteExpiredRecords()
      {
          try {
              $limit = (int)($this->limitDuration);
          } catch (\Exception $ex) {
              Yii::error($ex->getMessage(), __METHOD__);
              return 0;
          }
          $count = 0;
          $host = $this->host;
          /* @var $host \rhosocial\user\User */
          foreach (static::find()
                  ->createdBy($host)
                  ->andWhere(['<=', $this->createdAtAttribute, $this->offsetDatetime($this->currentUtcDatetime(), -$limit)])
                  ->all() as $login) {
              /* @var $login static */
              $result = $login->delete();
              $count += $result;
              if (YII_ENV_DEV) {
                  Yii::info($host->getReadableGUID() . ": ($result) login record created at (" . $login->getCreatedAt() . ") was just deleted.", __METHOD__);
              }
          }
          return $count;
      }
code_tokens: protected function deleteExpiredRecords ( ) { try { $ limit = ( int ) ( $ this -> limitDuration ) ; } catch ( \ Exception $ ex ) { Yii :: error ( $ ex -> getMessage ( ) , __METHOD__ ) ; return 0 ; } $ count = 0 ; $ host = $ this -> host ; /* @var $host \rhosocial\user\User */ foreach ( static :: find ( ) -> createdBy ( $ host ) -> andWhere ( [ '<=' , $ this -> createdAtAttribute , $ this -> offsetDatetime ( $ this -> currentUtcDatetime ( ) , - $ limit ) ] ) -> all ( ) as $ login ) { /* @var $login static */ $ result = $ login -> delete ( ) ; $ count += $ result ; if ( YII_ENV_DEV ) { Yii :: info ( $ host -> getReadableGUID ( ) . ": ($result) login record created at (" . $ login -> getCreatedAt ( ) . ") was just deleted." , __METHOD__ ) ; } } return $ count ; }
docstring: Delete expired records.
  @return integer The total of rows deleted.
docstring_tokens: Delete expired records .