Version 3.0

New technologies
This commit is contained in:
2022-08-05 21:28:59 -04:00
parent 06071884c7
commit a9968dec58
69 changed files with 600 additions and 2696 deletions

View File

@ -0,0 +1,27 @@
<?php
namespace Common\Concept;
interface Database
{
public function setHost(string $host, ?int $port = null): Database;
public function getHost(): string;
public function getPort(): int;
public function setName(string $database_name): Database;
public function getName(): string;
public function setUser(string $username, string $password): Database;
public function getUser(): string;
public function getPassword(): string;
public function getDsn(): string;
public function needsUser(): bool;
public function connect(): Database;
public function getConnection(): \PDO;
public function beginTransaction(): void;
public function commit(): void;
public function rollBack(): void;
public function query(string $query): array;
public function prepare(string $query): Database;
public function execute(array $data): array;
public function insert(array $values): void;
public function update(array $data): void;
public function delete(array $data): void;
}

View File

@ -1,11 +0,0 @@
<?php
namespace Contabilidad\Common\Concept;
use Contabilidad\Common\Alias\DocumentHandler as HandlerInterface;
abstract class DocumentHandler implements HandlerInterface {
protected string $folder;
public function __construct(string $source_folder) {
$this->folder = $source_folder;
}
}

View File

@ -0,0 +1,10 @@
<?php
namespace Common\Concept\Factory;
use Common\Concept\Model as ModelInterface;
use Common\Concept\Repository;
interface Model
{
public function find(ModelInterface $model_name): Repository;
}

View File

@ -0,0 +1,16 @@
<?php
namespace Common\Concept;
interface File
{
public function setFilename(string $filename): File;
public function getFilename(): string;
public function isDir(): bool;
public function isReadable(): bool;
public function isWriteable(): bool;
public function read(?int $length = null): string;
public function write(string $data, ?int $length = null);
public function append(string $data, ?int $length = null);
}

View File

@ -0,0 +1,17 @@
<?php
namespace Common\Concept;
interface Filesystem
{
public function setBasePath(string $path): Filesystem;
public function getBasePath(): string;
public function buildPath(string $relative_path): string;
public function has(string $relative_path): bool;
public function mkdir(string $relative_path): void;
public function create(string $relative_path): void;
public function get(string $relative_path): File;
public function delete(string $relative_path): void;
}

View File

@ -0,0 +1,6 @@
<?php
namespace Common\Concept;
interface Model
{
}

View File

@ -0,0 +1,11 @@
<?php
namespace Common\Concept;
interface Repository
{
public function fetchAll(): array;
public function fetchByKey($key): Model;
public function load(array $data_row): Model;
public function save(Model $model): void;
public function delete(Model $model): void;
}