_getTable()->searchBy(['email' => $email], 'id'))) { $this->setPrimaryKey($id); } return $this; } /** * Set primary key for recover code * * @param string $recoverCode * @return Obj */ public function setPrimaryKeyByRecoverCode($recoverCode) { if (false !== ($id = $this->_getTable()->searchBy(['recoverCode' => $recoverCode], 'id'))) { $this->setPrimaryKey($id); } return $this; } /** * Set code for password recover * * @param string $recoverCode * @param string $expirationDate * @return Obj */ public function setRecoverCode($recoverCode, $expirationDate) { $updateData = [ 'recoverCode' => $recoverCode, 'recoverCodeExpirationDate' => $expirationDate, ]; $this->_getTable()->updateByKey($updateData, $this->_primaryKey); return $this; } protected function _insertDependency() { return $this; } protected function _updateDependency() { return $this; } protected function _deleteDependency() { return $this; } }