<?php
/**
* Created by PhpStorm.
* User: andriyprosekov
* Date: 27/07/2018
* Time: 11:10
*/
namespace Audi2014\Auth\Credential;
use Audi2014\Repo\AbstractRepo;
class CredentialFbRepo extends AbstractRepo {
public function getTable(): string {
return '__auth__credential_fb';
}
public function getFields(): array {
return [
'__auth__credential_fb.*',
];
}
public function getGroupBy(): ?string {
return '__auth__credential_fb.profileId';
}
/**
* @param $key
* @param $value
* @return CredentialFbEntity
*/
public function fetchFirstByKeyValue(string $key, $value): ?CredentialFbEntity {
return parent::fetchFirstByKeyValue($key, $value); // TODO: Change the autogenerated stub
}
/**
* @param CredentialFbEntity $data
* @return void
* @throws \Exception
*/
public function insertCredential(CredentialFbEntity &$data): void {
$data->createdAt = time();
$data->updatedAt = time();
$data->id = parent::insertRow($data);
}
function willInsertData(array $data): array {
$data['updatedAt'] = time();
$data['createdAt'] = time();
return $data;
}
function willUpdateData(array $data): array {
$data['updatedAt'] = time();
return $data;
}
protected function getEntityClass(): string {
return CredentialFbEntity::class;
}
}
This repository has been archived by the owner on Jan 10, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
License
audi2014/php7-repo
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
No description, website, or topics provided.
Resources
License
Stars
Watchers
Forks
Packages 0
No packages published