adding db sql files and compiled code for tables

This commit is contained in:
Dario Rekowski on RockPI 2019-09-12 11:15:47 +00:00
commit 8c38a5529d
196 changed files with 14783 additions and 0 deletions

3
.gitmodules vendored Normal file
View File

@ -0,0 +1,3 @@
[submodule "mithril_client"]
path = mithril_client
url = ssh://git@***REMOVED***/~/_mithril/gradido_mithrilJS_client

51
README.md Normal file
View File

@ -0,0 +1,51 @@
# CakePHP Application Skeleton
[![Build Status](https://img.shields.io/travis/cakephp/app/master.svg?style=flat-square)](https://travis-ci.org/cakephp/app)
[![Total Downloads](https://img.shields.io/packagist/dt/cakephp/app.svg?style=flat-square)](https://packagist.org/packages/cakephp/app)
A skeleton for creating applications with [CakePHP](https://cakephp.org) 3.x.
The framework source code can be found here: [cakephp/cakephp](https://github.com/cakephp/cakephp).
## Installation
1. Download [Composer](https://getcomposer.org/doc/00-intro.md) or update `composer self-update`.
2. Run `php composer.phar create-project --prefer-dist cakephp/app [app_name]`.
If Composer is installed globally, run
```bash
composer create-project --prefer-dist cakephp/app
```
In case you want to use a custom app dir name (e.g. `/myapp/`):
```bash
composer create-project --prefer-dist cakephp/app myapp
```
You can now either use your machine's webserver to view the default home page, or start
up the built-in webserver with:
```bash
bin/cake server -p 8765
```
Then visit `http://localhost:8765` to see the welcome page.
## Update
Since this skeleton is a starting point for your application and various files
would have been modified as per your needs, there isn't a way to provide
automated upgrades, so you have to do any updates manually.
## Configuration
Read and edit `config/app.php` and setup the `'Datasources'` and any other
configuration relevant for your application.
## Layout
The app skeleton uses a subset of [Foundation](http://foundation.zurb.com/) (v5) CSS
framework by default. You can, however, replace it with any other library or
custom styles.

75
bin/cake Executable file
View File

@ -0,0 +1,75 @@
#!/usr/bin/env sh
################################################################################
#
# Cake is a shell script for invoking CakePHP shell commands
#
# CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
# Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
#
# Licensed under The MIT License
# For full copyright and license information, please see the LICENSE.txt
# Redistributions of files must retain the above copyright notice.
#
# @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
# @link https://cakephp.org CakePHP(tm) Project
# @since 1.2.0
# @license https://opensource.org/licenses/mit-license.php MIT License
#
################################################################################
# Canonicalize by following every symlink of the given name recursively
canonicalize() {
NAME="$1"
if [ -f "$NAME" ]
then
DIR=$(dirname -- "$NAME")
NAME=$(cd -P "$DIR" > /dev/null && pwd -P)/$(basename -- "$NAME")
fi
while [ -h "$NAME" ]; do
DIR=$(dirname -- "$NAME")
SYM=$(readlink "$NAME")
NAME=$(cd "$DIR" > /dev/null && cd "$(dirname -- "$SYM")" > /dev/null && pwd)/$(basename -- "$SYM")
done
echo "$NAME"
}
# Find a CLI version of PHP
findCliPhp() {
for TESTEXEC in php php-cli /usr/local/bin/php
do
SAPI=$(echo "<?= PHP_SAPI ?>" | $TESTEXEC 2>/dev/null)
if [ "$SAPI" = "cli" ]
then
echo $TESTEXEC
return
fi
done
echo "Failed to find a CLI version of PHP; falling back to system standard php executable" >&2
echo "php";
}
# If current path is a symlink, resolve to real path
realname="$0"
if [ -L "$realname" ]
then
realname=$(readlink -f "$0")
fi
CONSOLE=$(dirname -- "$(canonicalize "$realname")")
APP=$(dirname "$CONSOLE")
# If your CLI PHP is somewhere that this doesn't find, you can define a PHP environment
# variable with the correct path in it.
if [ -z "$PHP" ]
then
PHP=$(findCliPhp)
fi
if [ "$(basename "$realname")" != 'cake' ]
then
exec "$PHP" "$CONSOLE"/cake.php "$(basename "$realname")" "$@"
else
exec "$PHP" "$CONSOLE"/cake.php "$@"
fi
exit

27
bin/cake.bat Normal file
View File

@ -0,0 +1,27 @@
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
::
:: Cake is a Windows batch script for invoking CakePHP shell commands
::
:: CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
:: Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
::
:: Licensed under The MIT License
:: Redistributions of files must retain the above copyright notice.
::
:: @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
:: @link https://cakephp.org CakePHP(tm) Project
:: @since 2.0.0
:: @license https://opensource.org/licenses/mit-license.php MIT License
::
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
@echo off
SET app=%0
SET lib=%~dp0
php "%lib%cake.php" %*
echo.
exit /B %ERRORLEVEL%

12
bin/cake.php Normal file
View File

@ -0,0 +1,12 @@
#!/usr/bin/php -q
<?php
// Check platform requirements
require dirname(__DIR__) . '/config/requirements.php';
require dirname(__DIR__) . '/vendor/autoload.php';
use App\Application;
use Cake\Console\CommandRunner;
// Build the runner with an application and root executable name.
$runner = new CommandRunner(new Application(dirname(__DIR__) . '/config'), 'cake');
exit($runner->run($argv));

53
composer.json Normal file
View File

@ -0,0 +1,53 @@
{
"name": "cakephp/app",
"description": "CakePHP skeleton app",
"homepage": "https://cakephp.org",
"type": "project",
"license": "MIT",
"require": {
"php": ">=5.6",
"cakephp/cakephp": "3.8.*",
"cakephp/migrations": "^2.0.0",
"cakephp/plugin-installer": "^1.0",
"mobiledetect/mobiledetectlib": "2.*"
},
"require-dev": {
"cakephp/bake": "^1.9.0",
"cakephp/cakephp-codesniffer": "^3.0",
"cakephp/debug_kit": "^3.17.0",
"josegonzalez/dotenv": "3.*",
"phpunit/phpunit": "^5|^6",
"psy/psysh": "@stable"
},
"suggest": {
"markstory/asset_compress": "An asset compression plugin which provides file concatenation and a flexible filter system for preprocessing and minification.",
"dereuromark/cakephp-ide-helper": "After baking your code, this keeps your annotations in sync with the code evolving from there on for maximum IDE and PHPStan compatibility."
},
"autoload": {
"psr-4": {
"App\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"App\\Test\\": "tests/",
"Cake\\Test\\": "vendor/cakephp/cakephp/tests/"
}
},
"scripts": {
"post-install-cmd": "App\\Console\\Installer::postInstall",
"post-create-project-cmd": "App\\Console\\Installer::postInstall",
"post-autoload-dump": "Cake\\Composer\\Installer\\PluginInstaller::postAutoloadDump",
"check": [
"@test",
"@cs-check"
],
"cs-check": "phpcs --colors -p --standard=vendor/cakephp/cakephp-codesniffer/CakePHP src/ tests/",
"cs-fix": "phpcbf --colors --standard=vendor/cakephp/cakephp-codesniffer/CakePHP src/ tests/",
"test": "phpunit --colors=always"
},
"prefer-stable": true,
"config": {
"sort-packages": true
}
}

4332
composer.lock generated Normal file

File diff suppressed because it is too large Load Diff

6
db/address_types.sql Normal file
View File

@ -0,0 +1,6 @@
CREATE TABLE `address_types` (
`id` INT NOT NULL AUTO_INCREMENT,
`name` VARCHAR(25) NOT NULL,
`text` VARCHAR(255) NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;

7
db/operators.sql Normal file
View File

@ -0,0 +1,7 @@
CREATE TABLE `operators` (
`id` INT NOT NULL AUTO_INCREMENT ,
`username` VARCHAR(128) NOT NULL ,
`data_base64` VARCHAR(255) NOT NULL ,
PRIMARY KEY (`id`), UNIQUE (`username`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;

7
db/state_balances.sql Normal file
View File

@ -0,0 +1,7 @@
CREATE TABLE `state_balances` (
`id` int(11) NOT NULL,
`state_user_id` int(11) NOT NULL,
`modified` datetime NOT NULL,
`amount` bigint(20) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;

10
db/state_created.sql Normal file
View File

@ -0,0 +1,10 @@
CREATE TABLE `state_created` (
`id` int(11) NOT NULL,
`transaction_id` int(11) NOT NULL,
`month` tinyint(4) NOT NULL,
`year` smallint(6) NOT NULL,
`state_user_id` int(11) NOT NULL,
`created` datetime NOT NULL,
`short_ident_hash` int(11) NOT NULL,
PRIMARY KEY (`id`), INDEX(`short_ident_hash`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;

View File

@ -0,0 +1,7 @@
CREATE TABLE `state_group_addresses` (
`id` int(11) NOT NULL,
`state_group_id` int(11) NOT NULL,
`public_key` binary(32) NOT NULL,
`address_type_id` int(11) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;

View File

@ -0,0 +1,7 @@
CREATE TABLE `state_group_relationships` (
`id` int(11) NOT NULL,
`state_group1_id` int(11) NOT NULL,
`state_group2_id` int(11) NOT NULL,
`state_relationship_id` int(11) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;

8
db/state_groups.sql Normal file
View File

@ -0,0 +1,8 @@
CREATE TABLE `state_groups` (
`id` INT NOT NULL AUTO_INCREMENT,
`index_id` VARBINARY(64) NOT NULL,
`name` VARCHAR(50) NOT NULL,
`root_public_key` BINARY(32) NOT NULL,
`user_count` SMALLINT NOT NULL DEFAULT '0',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;

View File

@ -0,0 +1,6 @@
CREATE TABLE `state_relationship_types` (
`id` int(11) NOT NULL,
`name` varchar(25) COLLATE utf8_bin NOT NULL,
`text` varchar(255) COLLATE utf8_bin DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;

7
db/state_users.sql Normal file
View File

@ -0,0 +1,7 @@
CREATE TABLE `state_users` (
`id` int(11) NOT NULL,
`index_id` smallint(6) NOT NULL,
`state_group_id` int(11) NOT NULL,
`public_key` binary(32) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;

View File

@ -0,0 +1,10 @@
CREATE TABLE `transaction_creations` (
`id` int(11) NOT NULL,
`transaction_id` int(11) NOT NULL,
`state_user_id` int(11) NOT NULL,
`amount` bigint(20) NOT NULL,
`ident_hash` binary(32) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;

View File

@ -0,0 +1,8 @@
CREATE TABLE `transaction_group_addaddress` (
`id` int(11) NOT NULL,
`transaction_id` int(11) NOT NULL,
`address_type_id` int(11) NOT NULL,
`public_key` binary(32) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;

View File

@ -0,0 +1,8 @@
CREATE TABLE `transaction_group_allowtrades` (
`id` int(11) NOT NULL,
`transaction_id` int(11) NOT NULL,
`group_id` int(11) NOT NULL,
`allow` tinyint(1) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;

View File

@ -0,0 +1,9 @@
CREATE TABLE `transaction_group_creates` (
`id` int(11) NOT NULL,
`transaction_id` int(11) NOT NULL,
`group_public_key` binary(32) NOT NULL,
`state_group_id` int(11) COLLATE utf8_bin NOT NULL,
`name` varchar(64) COLLATE utf8_bin NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;

View File

@ -0,0 +1,11 @@
CREATE TABLE `transaction_send_coins` (
`id` int(11) NOT NULL,
`transaction_id` int(11) NOT NULL,
`state_user_id` int(11) NOT NULL,
`receiver_public_key` binary(32) NOT NULL,
`receiver_user_id` varbinary(64) NOT NULL,
`amount` bigint(20) NOT NULL,
`sender_final_balance` bigint(20) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;

View File

@ -0,0 +1,7 @@
CREATE TABLE `transaction_signatures` (
`id` int(11) NOT NULL,
`transaction_id` int(11) NOT NULL,
`signature` binary(64) NOT NULL,
`pubkey` binary(32) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;

6
db/transaction_types.sql Normal file
View File

@ -0,0 +1,6 @@
CREATE TABLE `transaction_types` (
`id` INT NOT NULL AUTO_INCREMENT,
`name` VARCHAR(24) NOT NULL,
`text` VARCHAR(255) NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;

9
db/transactions.sql Normal file
View File

@ -0,0 +1,9 @@
CREATE TABLE `transactions` (
`id` bigint(20) NOT NULL,
`state_group_id` int(11) NOT NULL,
`transaction_type_id` int(11) NOT NULL,
`tx_hash` binary(32) NOT NULL,
`received` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;

16
index.php Normal file
View File

@ -0,0 +1,16 @@
<?php
/**
* CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
* Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
*
* Licensed under The MIT License
* For full copyright and license information, please see the LICENSE.txt
* Redistributions of files must retain the above copyright notice.
*
* @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
* @link https://cakephp.org CakePHP(tm) Project
* @since 0.10.0
* @license https://opensource.org/licenses/mit-license.php MIT License
*/
require 'webroot' . DIRECTORY_SEPARATOR . 'index.php';

1
mithril_client Submodule

@ -0,0 +1 @@
Subproject commit 132a1de23b48f3b685e05fce6e1fbbb25b74671d

41
phpunit.xml.dist Normal file
View File

@ -0,0 +1,41 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit
colors="true"
processIsolation="false"
stopOnFailure="false"
bootstrap="tests/bootstrap.php"
>
<php>
<ini name="memory_limit" value="-1"/>
<ini name="apc.enable_cli" value="1"/>
</php>
<!-- Add any additional test suites you want to run here -->
<testsuites>
<testsuite name="app">
<directory>tests/TestCase/</directory>
</testsuite>
<!-- Add plugin test suites here. -->
</testsuites>
<!-- Setup a listener for fixtures -->
<listeners>
<listener
class="\Cake\TestSuite\Fixture\FixtureInjector">
<arguments>
<object class="\Cake\TestSuite\Fixture\FixtureManager" />
</arguments>
</listener>
</listeners>
<!-- Ignore vendor tests in code coverage reports -->
<filter>
<whitelist>
<directory suffix=".php">src/</directory>
<directory suffix=".php">plugins/*/src/</directory>
<exclude>
<file>src/Console/Installer.php</file>
</exclude>
</whitelist>
</filter>
</phpunit>

0
plugins/empty Normal file
View File

99
src/Application.php Normal file
View File

@ -0,0 +1,99 @@
<?php
/**
* CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
* Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
*
* Licensed under The MIT License
* For full copyright and license information, please see the LICENSE.txt
* Redistributions of files must retain the above copyright notice.
*
* @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
* @link https://cakephp.org CakePHP(tm) Project
* @since 3.3.0
* @license https://opensource.org/licenses/mit-license.php MIT License
*/
namespace App;
use Cake\Core\Configure;
use Cake\Core\Exception\MissingPluginException;
use Cake\Error\Middleware\ErrorHandlerMiddleware;
use Cake\Http\BaseApplication;
use Cake\Routing\Middleware\AssetMiddleware;
use Cake\Routing\Middleware\RoutingMiddleware;
/**
* Application setup class.
*
* This defines the bootstrapping logic and middleware layers you
* want to use in your application.
*/
class Application extends BaseApplication
{
/**
* {@inheritDoc}
*/
public function bootstrap()
{
// Call parent to load bootstrap from files.
parent::bootstrap();
if (PHP_SAPI === 'cli') {
$this->bootstrapCli();
}
/*
* Only try to load DebugKit in development mode
* Debug Kit should not be installed on a production system
*/
if (Configure::read('debug')) {
$this->addPlugin(\DebugKit\Plugin::class);
}
// Load more plugins here
}
/**
* Setup the middleware queue your application will use.
*
* @param \Cake\Http\MiddlewareQueue $middlewareQueue The middleware queue to setup.
* @return \Cake\Http\MiddlewareQueue The updated middleware queue.
*/
public function middleware($middlewareQueue)
{
$middlewareQueue
// Catch any exceptions in the lower layers,
// and make an error page/response
->add(new ErrorHandlerMiddleware(null, Configure::read('Error')))
// Handle plugin/theme assets like CakePHP normally does.
->add(new AssetMiddleware([
'cacheTime' => Configure::read('Asset.cacheTime')
]))
// Add routing middleware.
// If you have a large number of routes connected, turning on routes
// caching in production could improve performance. For that when
// creating the middleware instance specify the cache config name by
// using it's second constructor argument:
// `new RoutingMiddleware($this, '_cake_routes_')`
->add(new RoutingMiddleware($this));
return $middlewareQueue;
}
/**
* @return void
*/
protected function bootstrapCli()
{
try {
$this->addPlugin('Bake');
} catch (MissingPluginException $e) {
// Do not halt if the plugin is missing
}
$this->addPlugin('Migrations');
// Load more plugins here
}
}

246
src/Console/Installer.php Normal file
View File

@ -0,0 +1,246 @@
<?php
/**
* CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
* Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
*
* Licensed under The MIT License
* For full copyright and license information, please see the LICENSE.txt
* Redistributions of files must retain the above copyright notice.
*
* @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
* @link https://cakephp.org CakePHP(tm) Project
* @since 3.0.0
* @license https://opensource.org/licenses/mit-license.php MIT License
*/
namespace App\Console;
if (!defined('STDIN')) {
define('STDIN', fopen('php://stdin', 'r'));
}
use Cake\Utility\Security;
use Composer\Script\Event;
use Exception;
/**
* Provides installation hooks for when this application is installed via
* composer. Customize this class to suit your needs.
*/
class Installer
{
/**
* An array of directories to be made writable
*/
const WRITABLE_DIRS = [
'logs',
'tmp',
'tmp/cache',
'tmp/cache/models',
'tmp/cache/persistent',
'tmp/cache/views',
'tmp/sessions',
'tmp/tests'
];
/**
* Does some routine installation tasks so people don't have to.
*
* @param \Composer\Script\Event $event The composer event object.
* @throws \Exception Exception raised by validator.
* @return void
*/
public static function postInstall(Event $event)
{
$io = $event->getIO();
$rootDir = dirname(dirname(__DIR__));
static::createAppConfig($rootDir, $io);
static::createWritableDirectories($rootDir, $io);
// ask if the permissions should be changed
if ($io->isInteractive()) {
$validator = function ($arg) {
if (in_array($arg, ['Y', 'y', 'N', 'n'])) {
return $arg;
}
throw new Exception('This is not a valid answer. Please choose Y or n.');
};
$setFolderPermissions = $io->askAndValidate(
'<info>Set Folder Permissions ? (Default to Y)</info> [<comment>Y,n</comment>]? ',
$validator,
10,
'Y'
);
if (in_array($setFolderPermissions, ['Y', 'y'])) {
static::setFolderPermissions($rootDir, $io);
}
} else {
static::setFolderPermissions($rootDir, $io);
}
static::setSecuritySalt($rootDir, $io);
$class = 'Cake\Codeception\Console\Installer';
if (class_exists($class)) {
$class::customizeCodeceptionBinary($event);
}
}
/**
* Create the config/app.php file if it does not exist.
*
* @param string $dir The application's root directory.
* @param \Composer\IO\IOInterface $io IO interface to write to console.
* @return void
*/
public static function createAppConfig($dir, $io)
{
$appConfig = $dir . '/config/app.php';
$defaultConfig = $dir . '/config/app.default.php';
if (!file_exists($appConfig)) {
copy($defaultConfig, $appConfig);
$io->write('Created `config/app.php` file');
}
}
/**
* Create the `logs` and `tmp` directories.
*
* @param string $dir The application's root directory.
* @param \Composer\IO\IOInterface $io IO interface to write to console.
* @return void
*/
public static function createWritableDirectories($dir, $io)
{
foreach (static::WRITABLE_DIRS as $path) {
$path = $dir . '/' . $path;
if (!file_exists($path)) {
mkdir($path);
$io->write('Created `' . $path . '` directory');
}
}
}
/**
* Set globally writable permissions on the "tmp" and "logs" directory.
*
* This is not the most secure default, but it gets people up and running quickly.
*
* @param string $dir The application's root directory.
* @param \Composer\IO\IOInterface $io IO interface to write to console.
* @return void
*/
public static function setFolderPermissions($dir, $io)
{
// Change the permissions on a path and output the results.
$changePerms = function ($path) use ($io) {
$currentPerms = fileperms($path) & 0777;
$worldWritable = $currentPerms | 0007;
if ($worldWritable == $currentPerms) {
return;
}
$res = chmod($path, $worldWritable);
if ($res) {
$io->write('Permissions set on ' . $path);
} else {
$io->write('Failed to set permissions on ' . $path);
}
};
$walker = function ($dir) use (&$walker, $changePerms) {
$files = array_diff(scandir($dir), ['.', '..']);
foreach ($files as $file) {
$path = $dir . '/' . $file;
if (!is_dir($path)) {
continue;
}
$changePerms($path);
$walker($path);
}
};
$walker($dir . '/tmp');
$changePerms($dir . '/tmp');
$changePerms($dir . '/logs');
}
/**
* Set the security.salt value in the application's config file.
*
* @param string $dir The application's root directory.
* @param \Composer\IO\IOInterface $io IO interface to write to console.
* @return void
*/
public static function setSecuritySalt($dir, $io)
{
$newKey = hash('sha256', Security::randomBytes(64));
static::setSecuritySaltInFile($dir, $io, $newKey, 'app.php');
}
/**
* Set the security.salt value in a given file
*
* @param string $dir The application's root directory.
* @param \Composer\IO\IOInterface $io IO interface to write to console.
* @param string $newKey key to set in the file
* @param string $file A path to a file relative to the application's root
* @return void
*/
public static function setSecuritySaltInFile($dir, $io, $newKey, $file)
{
$config = $dir . '/config/' . $file;
$content = file_get_contents($config);
$content = str_replace('__SALT__', $newKey, $content, $count);
if ($count == 0) {
$io->write('No Security.salt placeholder to replace.');
return;
}
$result = file_put_contents($config, $content);
if ($result) {
$io->write('Updated Security.salt value in config/' . $file);
return;
}
$io->write('Unable to update Security.salt value.');
}
/**
* Set the APP_NAME value in a given file
*
* @param string $dir The application's root directory.
* @param \Composer\IO\IOInterface $io IO interface to write to console.
* @param string $appName app name to set in the file
* @param string $file A path to a file relative to the application's root
* @return void
*/
public static function setAppNameInFile($dir, $io, $appName, $file)
{
$config = $dir . '/config/' . $file;
$content = file_get_contents($config);
$content = str_replace('__APP_NAME__', $appName, $content, $count);
if ($count == 0) {
$io->write('No __APP_NAME__ placeholder to replace.');
return;
}
$result = file_put_contents($config, $content);
if ($result) {
$io->write('Updated __APP_NAME__ value in config/' . $file);
return;
}
$io->write('Unable to update __APP_NAME__ value.');
}
}

View File

@ -0,0 +1,106 @@
<?php
namespace App\Controller;
use App\Controller\AppController;
/**
* AddressTypes Controller
*
* @property \App\Model\Table\AddressTypesTable $AddressTypes
*
* @method \App\Model\Entity\AddressType[]|\Cake\Datasource\ResultSetInterface paginate($object = null, array $settings = [])
*/
class AddressTypesController extends AppController
{
/**
* Index method
*
* @return \Cake\Http\Response|null
*/
public function index()
{
$addressTypes = $this->paginate($this->AddressTypes);
$this->set(compact('addressTypes'));
}
/**
* View method
*
* @param string|null $id Address Type id.
* @return \Cake\Http\Response|null
* @throws \Cake\Datasource\Exception\RecordNotFoundException When record not found.
*/
public function view($id = null)
{
$addressType = $this->AddressTypes->get($id, [
'contain' => ['StateGroupAddresses', 'TransactionGroupAddaddress']
]);
$this->set('addressType', $addressType);
}
/**
* Add method
*
* @return \Cake\Http\Response|null Redirects on successful add, renders view otherwise.
*/
public function add()
{
$addressType = $this->AddressTypes->newEntity();
if ($this->request->is('post')) {
$addressType = $this->AddressTypes->patchEntity($addressType, $this->request->getData());
if ($this->AddressTypes->save($addressType)) {
$this->Flash->success(__('The address type has been saved.'));
return $this->redirect(['action' => 'index']);
}
$this->Flash->error(__('The address type could not be saved. Please, try again.'));
}
$this->set(compact('addressType'));
}
/**
* Edit method
*
* @param string|null $id Address Type id.
* @return \Cake\Http\Response|null Redirects on successful edit, renders view otherwise.
* @throws \Cake\Datasource\Exception\RecordNotFoundException When record not found.
*/
public function edit($id = null)
{
$addressType = $this->AddressTypes->get($id, [
'contain' => []
]);
if ($this->request->is(['patch', 'post', 'put'])) {
$addressType = $this->AddressTypes->patchEntity($addressType, $this->request->getData());
if ($this->AddressTypes->save($addressType)) {
$this->Flash->success(__('The address type has been saved.'));
return $this->redirect(['action' => 'index']);
}
$this->Flash->error(__('The address type could not be saved. Please, try again.'));
}
$this->set(compact('addressType'));
}
/**
* Delete method
*
* @param string|null $id Address Type id.
* @return \Cake\Http\Response|null Redirects to index.
* @throws \Cake\Datasource\Exception\RecordNotFoundException When record not found.
*/
public function delete($id = null)
{
$this->request->allowMethod(['post', 'delete']);
$addressType = $this->AddressTypes->get($id);
if ($this->AddressTypes->delete($addressType)) {
$this->Flash->success(__('The address type has been deleted.'));
} else {
$this->Flash->error(__('The address type could not be deleted. Please, try again.'));
}
return $this->redirect(['action' => 'index']);
}
}

View File

@ -0,0 +1,55 @@
<?php
/**
* CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
* Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
*
* Licensed under The MIT License
* For full copyright and license information, please see the LICENSE.txt
* Redistributions of files must retain the above copyright notice.
*
* @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
* @link https://cakephp.org CakePHP(tm) Project
* @since 0.2.9
* @license https://opensource.org/licenses/mit-license.php MIT License
*/
namespace App\Controller;
use Cake\Controller\Controller;
use Cake\Event\Event;
/**
* Application Controller
*
* Add your application-wide methods in the class below, your controllers
* will inherit them.
*
* @link https://book.cakephp.org/3.0/en/controllers.html#the-app-controller
*/
class AppController extends Controller
{
/**
* Initialization hook method.
*
* Use this method to add common initialization code like loading components.
*
* e.g. `$this->loadComponent('Security');`
*
* @return void
*/
public function initialize()
{
parent::initialize();
$this->loadComponent('RequestHandler', [
'enableBeforeRedirect' => false,
]);
$this->loadComponent('Flash');
/*
* Enable the following component for recommended CakePHP security settings.
* see https://book.cakephp.org/3.0/en/controllers/components/security.html
*/
//$this->loadComponent('Security');
}
}

View File

View File

@ -0,0 +1,70 @@
<?php
/**
* CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
* Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
*
* Licensed under The MIT License
* For full copyright and license information, please see the LICENSE.txt
* Redistributions of files must retain the above copyright notice.
*
* @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
* @link https://cakephp.org CakePHP(tm) Project
* @since 3.3.4
* @license https://opensource.org/licenses/mit-license.php MIT License
*/
namespace App\Controller;
use Cake\Event\Event;
/**
* Error Handling Controller
*
* Controller used by ExceptionRenderer to render error responses.
*/
class ErrorController extends AppController
{
/**
* Initialization hook method.
*
* @return void
*/
public function initialize()
{
$this->loadComponent('RequestHandler', [
'enableBeforeRedirect' => false,
]);
}
/**
* beforeFilter callback.
*
* @param \Cake\Event\Event $event Event.
* @return \Cake\Http\Response|null|void
*/
public function beforeFilter(Event $event)
{
}
/**
* beforeRender callback.
*
* @param \Cake\Event\Event $event Event.
* @return \Cake\Http\Response|null|void
*/
public function beforeRender(Event $event)
{
parent::beforeRender($event);
$this->viewBuilder()->setTemplatePath('Error');
}
/**
* afterFilter callback.
*
* @param \Cake\Event\Event $event Event.
* @return \Cake\Http\Response|null|void
*/
public function afterFilter(Event $event)
{
}
}

View File

@ -0,0 +1,106 @@
<?php
namespace App\Controller;
use App\Controller\AppController;
/**
* Operators Controller
*
* @property \App\Model\Table\OperatorsTable $Operators
*
* @method \App\Model\Entity\Operator[]|\Cake\Datasource\ResultSetInterface paginate($object = null, array $settings = [])
*/
class OperatorsController extends AppController
{
/**
* Index method
*
* @return \Cake\Http\Response|null
*/
public function index()
{
$operators = $this->paginate($this->Operators);
$this->set(compact('operators'));
}
/**
* View method
*
* @param string|null $id Operator id.
* @return \Cake\Http\Response|null
* @throws \Cake\Datasource\Exception\RecordNotFoundException When record not found.
*/
public function view($id = null)
{
$operator = $this->Operators->get($id, [
'contain' => []
]);
$this->set('operator', $operator);
}
/**
* Add method
*
* @return \Cake\Http\Response|null Redirects on successful add, renders view otherwise.
*/
public function add()
{
$operator = $this->Operators->newEntity();
if ($this->request->is('post')) {
$operator = $this->Operators->patchEntity($operator, $this->request->getData());
if ($this->Operators->save($operator)) {
$this->Flash->success(__('The operator has been saved.'));
return $this->redirect(['action' => 'index']);
}
$this->Flash->error(__('The operator could not be saved. Please, try again.'));
}
$this->set(compact('operator'));
}
/**
* Edit method
*
* @param string|null $id Operator id.
* @return \Cake\Http\Response|null Redirects on successful edit, renders view otherwise.
* @throws \Cake\Datasource\Exception\RecordNotFoundException When record not found.
*/
public function edit($id = null)
{
$operator = $this->Operators->get($id, [
'contain' => []
]);
if ($this->request->is(['patch', 'post', 'put'])) {
$operator = $this->Operators->patchEntity($operator, $this->request->getData());
if ($this->Operators->save($operator)) {
$this->Flash->success(__('The operator has been saved.'));
return $this->redirect(['action' => 'index']);
}
$this->Flash->error(__('The operator could not be saved. Please, try again.'));
}
$this->set(compact('operator'));
}
/**
* Delete method
*
* @param string|null $id Operator id.
* @return \Cake\Http\Response|null Redirects to index.
* @throws \Cake\Datasource\Exception\RecordNotFoundException When record not found.
*/
public function delete($id = null)
{
$this->request->allowMethod(['post', 'delete']);
$operator = $this->Operators->get($id);
if ($this->Operators->delete($operator)) {
$this->Flash->success(__('The operator has been deleted.'));
} else {
$this->Flash->error(__('The operator could not be deleted. Please, try again.'));
}
return $this->redirect(['action' => 'index']);
}
}

View File

@ -0,0 +1,69 @@
<?php
/**
* CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
* Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
*
* Licensed under The MIT License
* For full copyright and license information, please see the LICENSE.txt
* Redistributions of files must retain the above copyright notice.
*
* @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
* @link https://cakephp.org CakePHP(tm) Project
* @since 0.2.9
* @license https://opensource.org/licenses/mit-license.php MIT License
*/
namespace App\Controller;
use Cake\Core\Configure;
use Cake\Http\Exception\ForbiddenException;
use Cake\Http\Exception\NotFoundException;
use Cake\View\Exception\MissingTemplateException;
/**
* Static content controller
*
* This controller will render views from Template/Pages/
*
* @link https://book.cakephp.org/3.0/en/controllers/pages-controller.html
*/
class PagesController extends AppController
{
/**
* Displays a view
*
* @param array ...$path Path segments.
* @return \Cake\Http\Response|null
* @throws \Cake\Http\Exception\ForbiddenException When a directory traversal attempt.
* @throws \Cake\Http\Exception\NotFoundException When the view file could not
* be found or \Cake\View\Exception\MissingTemplateException in debug mode.
*/
public function display(...$path)
{
$count = count($path);
if (!$count) {
return $this->redirect('/');
}
if (in_array('..', $path, true) || in_array('.', $path, true)) {
throw new ForbiddenException();
}
$page = $subpage = null;
if (!empty($path[0])) {
$page = $path[0];
}
if (!empty($path[1])) {
$subpage = $path[1];
}
$this->set(compact('page', 'subpage'));
try {
$this->render(implode('/', $path));
} catch (MissingTemplateException $exception) {
if (Configure::read('debug')) {
throw $exception;
}
throw new NotFoundException();
}
}
}

View File

@ -0,0 +1,111 @@
<?php
namespace App\Controller;
use App\Controller\AppController;
/**
* StateBalances Controller
*
* @property \App\Model\Table\StateBalancesTable $StateBalances
*
* @method \App\Model\Entity\StateBalance[]|\Cake\Datasource\ResultSetInterface paginate($object = null, array $settings = [])
*/
class StateBalancesController extends AppController
{
/**
* Index method
*
* @return \Cake\Http\Response|null
*/
public function index()
{
$this->paginate = [
'contain' => ['StateUsers']
];
$stateBalances = $this->paginate($this->StateBalances);
$this->set(compact('stateBalances'));
}
/**
* View method
*
* @param string|null $id State Balance id.
* @return \Cake\Http\Response|null
* @throws \Cake\Datasource\Exception\RecordNotFoundException When record not found.
*/
public function view($id = null)
{
$stateBalance = $this->StateBalances->get($id, [
'contain' => ['StateUsers']
]);
$this->set('stateBalance', $stateBalance);
}
/**
* Add method
*
* @return \Cake\Http\Response|null Redirects on successful add, renders view otherwise.
*/
public function add()
{
$stateBalance = $this->StateBalances->newEntity();
if ($this->request->is('post')) {
$stateBalance = $this->StateBalances->patchEntity($stateBalance, $this->request->getData());
if ($this->StateBalances->save($stateBalance)) {
$this->Flash->success(__('The state balance has been saved.'));
return $this->redirect(['action' => 'index']);
}
$this->Flash->error(__('The state balance could not be saved. Please, try again.'));
}
$stateUsers = $this->StateBalances->StateUsers->find('list', ['limit' => 200]);
$this->set(compact('stateBalance', 'stateUsers'));
}
/**
* Edit method
*
* @param string|null $id State Balance id.
* @return \Cake\Http\Response|null Redirects on successful edit, renders view otherwise.
* @throws \Cake\Datasource\Exception\RecordNotFoundException When record not found.
*/
public function edit($id = null)
{
$stateBalance = $this->StateBalances->get($id, [
'contain' => []
]);
if ($this->request->is(['patch', 'post', 'put'])) {
$stateBalance = $this->StateBalances->patchEntity($stateBalance, $this->request->getData());
if ($this->StateBalances->save($stateBalance)) {
$this->Flash->success(__('The state balance has been saved.'));
return $this->redirect(['action' => 'index']);
}
$this->Flash->error(__('The state balance could not be saved. Please, try again.'));
}
$stateUsers = $this->StateBalances->StateUsers->find('list', ['limit' => 200]);
$this->set(compact('stateBalance', 'stateUsers'));
}
/**
* Delete method
*
* @param string|null $id State Balance id.
* @return \Cake\Http\Response|null Redirects to index.
* @throws \Cake\Datasource\Exception\RecordNotFoundException When record not found.
*/
public function delete($id = null)
{
$this->request->allowMethod(['post', 'delete']);
$stateBalance = $this->StateBalances->get($id);
if ($this->StateBalances->delete($stateBalance)) {
$this->Flash->success(__('The state balance has been deleted.'));
} else {
$this->Flash->error(__('The state balance could not be deleted. Please, try again.'));
}
return $this->redirect(['action' => 'index']);
}
}

View File

@ -0,0 +1,113 @@
<?php
namespace App\Controller;
use App\Controller\AppController;
/**
* StateCreated Controller
*
* @property \App\Model\Table\StateCreatedTable $StateCreated
*
* @method \App\Model\Entity\StateCreated[]|\Cake\Datasource\ResultSetInterface paginate($object = null, array $settings = [])
*/
class StateCreatedController extends AppController
{
/**
* Index method
*
* @return \Cake\Http\Response|null
*/
public function index()
{
$this->paginate = [
'contain' => ['Transactions', 'StateUsers']
];
$stateCreated = $this->paginate($this->StateCreated);
$this->set(compact('stateCreated'));
}
/**
* View method
*
* @param string|null $id State Created id.
* @return \Cake\Http\Response|null
* @throws \Cake\Datasource\Exception\RecordNotFoundException When record not found.
*/
public function view($id = null)
{
$stateCreated = $this->StateCreated->get($id, [
'contain' => ['Transactions', 'StateUsers']
]);
$this->set('stateCreated', $stateCreated);
}
/**
* Add method
*
* @return \Cake\Http\Response|null Redirects on successful add, renders view otherwise.
*/
public function add()
{
$stateCreated = $this->StateCreated->newEntity();
if ($this->request->is('post')) {
$stateCreated = $this->StateCreated->patchEntity($stateCreated, $this->request->getData());
if ($this->StateCreated->save($stateCreated)) {
$this->Flash->success(__('The state created has been saved.'));
return $this->redirect(['action' => 'index']);
}
$this->Flash->error(__('The state created could not be saved. Please, try again.'));
}
$transactions = $this->StateCreated->Transactions->find('list', ['limit' => 200]);
$stateUsers = $this->StateCreated->StateUsers->find('list', ['limit' => 200]);
$this->set(compact('stateCreated', 'transactions', 'stateUsers'));
}
/**
* Edit method
*
* @param string|null $id State Created id.
* @return \Cake\Http\Response|null Redirects on successful edit, renders view otherwise.
* @throws \Cake\Datasource\Exception\RecordNotFoundException When record not found.
*/
public function edit($id = null)
{
$stateCreated = $this->StateCreated->get($id, [
'contain' => []
]);
if ($this->request->is(['patch', 'post', 'put'])) {
$stateCreated = $this->StateCreated->patchEntity($stateCreated, $this->request->getData());
if ($this->StateCreated->save($stateCreated)) {
$this->Flash->success(__('The state created has been saved.'));
return $this->redirect(['action' => 'index']);
}
$this->Flash->error(__('The state created could not be saved. Please, try again.'));
}
$transactions = $this->StateCreated->Transactions->find('list', ['limit' => 200]);
$stateUsers = $this->StateCreated->StateUsers->find('list', ['limit' => 200]);
$this->set(compact('stateCreated', 'transactions', 'stateUsers'));
}
/**
* Delete method
*
* @param string|null $id State Created id.
* @return \Cake\Http\Response|null Redirects to index.
* @throws \Cake\Datasource\Exception\RecordNotFoundException When record not found.
*/
public function delete($id = null)
{
$this->request->allowMethod(['post', 'delete']);
$stateCreated = $this->StateCreated->get($id);
if ($this->StateCreated->delete($stateCreated)) {
$this->Flash->success(__('The state created has been deleted.'));
} else {
$this->Flash->error(__('The state created could not be deleted. Please, try again.'));
}
return $this->redirect(['action' => 'index']);
}
}

View File

@ -0,0 +1,113 @@
<?php
namespace App\Controller;
use App\Controller\AppController;
/**
* StateGroupAddresses Controller
*
* @property \App\Model\Table\StateGroupAddressesTable $StateGroupAddresses
*
* @method \App\Model\Entity\StateGroupAddress[]|\Cake\Datasource\ResultSetInterface paginate($object = null, array $settings = [])
*/
class StateGroupAddressesController extends AppController
{
/**
* Index method
*
* @return \Cake\Http\Response|null
*/
public function index()
{
$this->paginate = [
'contain' => ['StateGroups', 'AddressTypes']
];
$stateGroupAddresses = $this->paginate($this->StateGroupAddresses);
$this->set(compact('stateGroupAddresses'));
}
/**
* View method
*
* @param string|null $id State Group Address id.
* @return \Cake\Http\Response|null
* @throws \Cake\Datasource\Exception\RecordNotFoundException When record not found.
*/
public function view($id = null)
{
$stateGroupAddress = $this->StateGroupAddresses->get($id, [
'contain' => ['StateGroups', 'AddressTypes']
]);
$this->set('stateGroupAddress', $stateGroupAddress);
}
/**
* Add method
*
* @return \Cake\Http\Response|null Redirects on successful add, renders view otherwise.
*/
public function add()
{
$stateGroupAddress = $this->StateGroupAddresses->newEntity();
if ($this->request->is('post')) {
$stateGroupAddress = $this->StateGroupAddresses->patchEntity($stateGroupAddress, $this->request->getData());
if ($this->StateGroupAddresses->save($stateGroupAddress)) {
$this->Flash->success(__('The state group address has been saved.'));
return $this->redirect(['action' => 'index']);
}
$this->Flash->error(__('The state group address could not be saved. Please, try again.'));
}
$stateGroups = $this->StateGroupAddresses->StateGroups->find('list', ['limit' => 200]);
$addressTypes = $this->StateGroupAddresses->AddressTypes->find('list', ['limit' => 200]);
$this->set(compact('stateGroupAddress', 'stateGroups', 'addressTypes'));
}
/**
* Edit method
*
* @param string|null $id State Group Address id.
* @return \Cake\Http\Response|null Redirects on successful edit, renders view otherwise.
* @throws \Cake\Datasource\Exception\RecordNotFoundException When record not found.
*/
public function edit($id = null)
{
$stateGroupAddress = $this->StateGroupAddresses->get($id, [
'contain' => []
]);
if ($this->request->is(['patch', 'post', 'put'])) {
$stateGroupAddress = $this->StateGroupAddresses->patchEntity($stateGroupAddress, $this->request->getData());
if ($this->StateGroupAddresses->save($stateGroupAddress)) {
$this->Flash->success(__('The state group address has been saved.'));
return $this->redirect(['action' => 'index']);
}
$this->Flash->error(__('The state group address could not be saved. Please, try again.'));
}
$stateGroups = $this->StateGroupAddresses->StateGroups->find('list', ['limit' => 200]);
$addressTypes = $this->StateGroupAddresses->AddressTypes->find('list', ['limit' => 200]);
$this->set(compact('stateGroupAddress', 'stateGroups', 'addressTypes'));
}
/**
* Delete method
*
* @param string|null $id State Group Address id.
* @return \Cake\Http\Response|null Redirects to index.
* @throws \Cake\Datasource\Exception\RecordNotFoundException When record not found.
*/
public function delete($id = null)
{
$this->request->allowMethod(['post', 'delete']);
$stateGroupAddress = $this->StateGroupAddresses->get($id);
if ($this->StateGroupAddresses->delete($stateGroupAddress)) {
$this->Flash->success(__('The state group address has been deleted.'));
} else {
$this->Flash->error(__('The state group address could not be deleted. Please, try again.'));
}
return $this->redirect(['action' => 'index']);
}
}

View File

@ -0,0 +1,115 @@
<?php
namespace App\Controller;
use App\Controller\AppController;
/**
* StateGroupRelationships Controller
*
* @property \App\Model\Table\StateGroupRelationshipsTable $StateGroupRelationships
*
* @method \App\Model\Entity\StateGroupRelationship[]|\Cake\Datasource\ResultSetInterface paginate($object = null, array $settings = [])
*/
class StateGroupRelationshipsController extends AppController
{
/**
* Index method
*
* @return \Cake\Http\Response|null
*/
public function index()
{
$this->paginate = [
'contain' => ['StateGroup1s', 'StateGroup2s', 'StateRelationships']
];
$stateGroupRelationships = $this->paginate($this->StateGroupRelationships);
$this->set(compact('stateGroupRelationships'));
}
/**
* View method
*
* @param string|null $id State Group Relationship id.
* @return \Cake\Http\Response|null
* @throws \Cake\Datasource\Exception\RecordNotFoundException When record not found.
*/
public function view($id = null)
{
$stateGroupRelationship = $this->StateGroupRelationships->get($id, [
'contain' => ['StateGroup1s', 'StateGroup2s', 'StateRelationships']
]);
$this->set('stateGroupRelationship', $stateGroupRelationship);
}
/**
* Add method
*
* @return \Cake\Http\Response|null Redirects on successful add, renders view otherwise.
*/
public function add()
{
$stateGroupRelationship = $this->StateGroupRelationships->newEntity();
if ($this->request->is('post')) {
$stateGroupRelationship = $this->StateGroupRelationships->patchEntity($stateGroupRelationship, $this->request->getData());
if ($this->StateGroupRelationships->save($stateGroupRelationship)) {
$this->Flash->success(__('The state group relationship has been saved.'));
return $this->redirect(['action' => 'index']);
}
$this->Flash->error(__('The state group relationship could not be saved. Please, try again.'));
}
$stateGroup1s = $this->StateGroupRelationships->StateGroup1s->find('list', ['limit' => 200]);
$stateGroup2s = $this->StateGroupRelationships->StateGroup2s->find('list', ['limit' => 200]);
$stateRelationships = $this->StateGroupRelationships->StateRelationships->find('list', ['limit' => 200]);
$this->set(compact('stateGroupRelationship', 'stateGroup1s', 'stateGroup2s', 'stateRelationships'));
}
/**
* Edit method
*
* @param string|null $id State Group Relationship id.
* @return \Cake\Http\Response|null Redirects on successful edit, renders view otherwise.
* @throws \Cake\Datasource\Exception\RecordNotFoundException When record not found.
*/
public function edit($id = null)
{
$stateGroupRelationship = $this->StateGroupRelationships->get($id, [
'contain' => []
]);
if ($this->request->is(['patch', 'post', 'put'])) {
$stateGroupRelationship = $this->StateGroupRelationships->patchEntity($stateGroupRelationship, $this->request->getData());
if ($this->StateGroupRelationships->save($stateGroupRelationship)) {
$this->Flash->success(__('The state group relationship has been saved.'));
return $this->redirect(['action' => 'index']);
}
$this->Flash->error(__('The state group relationship could not be saved. Please, try again.'));
}
$stateGroup1s = $this->StateGroupRelationships->StateGroup1s->find('list', ['limit' => 200]);
$stateGroup2s = $this->StateGroupRelationships->StateGroup2s->find('list', ['limit' => 200]);
$stateRelationships = $this->StateGroupRelationships->StateRelationships->find('list', ['limit' => 200]);
$this->set(compact('stateGroupRelationship', 'stateGroup1s', 'stateGroup2s', 'stateRelationships'));
}
/**
* Delete method
*
* @param string|null $id State Group Relationship id.
* @return \Cake\Http\Response|null Redirects to index.
* @throws \Cake\Datasource\Exception\RecordNotFoundException When record not found.
*/
public function delete($id = null)
{
$this->request->allowMethod(['post', 'delete']);
$stateGroupRelationship = $this->StateGroupRelationships->get($id);
if ($this->StateGroupRelationships->delete($stateGroupRelationship)) {
$this->Flash->success(__('The state group relationship has been deleted.'));
} else {
$this->Flash->error(__('The state group relationship could not be deleted. Please, try again.'));
}
return $this->redirect(['action' => 'index']);
}
}

View File

@ -0,0 +1,111 @@
<?php
namespace App\Controller;
use App\Controller\AppController;
/**
* StateGroups Controller
*
* @property \App\Model\Table\StateGroupsTable $StateGroups
*
* @method \App\Model\Entity\StateGroup[]|\Cake\Datasource\ResultSetInterface paginate($object = null, array $settings = [])
*/
class StateGroupsController extends AppController
{
/**
* Index method
*
* @return \Cake\Http\Response|null
*/
public function index()
{
$this->paginate = [
'contain' => ['Indices']
];
$stateGroups = $this->paginate($this->StateGroups);
$this->set(compact('stateGroups'));
}
/**
* View method
*
* @param string|null $id State Group id.
* @return \Cake\Http\Response|null
* @throws \Cake\Datasource\Exception\RecordNotFoundException When record not found.
*/
public function view($id = null)
{
$stateGroup = $this->StateGroups->get($id, [
'contain' => ['Indices', 'StateGroupAddresses', 'StateUsers', 'TransactionGroupCreates', 'Transactions']
]);
$this->set('stateGroup', $stateGroup);
}
/**
* Add method
*
* @return \Cake\Http\Response|null Redirects on successful add, renders view otherwise.
*/
public function add()
{
$stateGroup = $this->StateGroups->newEntity();
if ($this->request->is('post')) {
$stateGroup = $this->StateGroups->patchEntity($stateGroup, $this->request->getData());
if ($this->StateGroups->save($stateGroup)) {
$this->Flash->success(__('The state group has been saved.'));
return $this->redirect(['action' => 'index']);
}
$this->Flash->error(__('The state group could not be saved. Please, try again.'));
}
$indices = $this->StateGroups->Indices->find('list', ['limit' => 200]);
$this->set(compact('stateGroup', 'indices'));
}
/**
* Edit method
*
* @param string|null $id State Group id.
* @return \Cake\Http\Response|null Redirects on successful edit, renders view otherwise.
* @throws \Cake\Datasource\Exception\RecordNotFoundException When record not found.
*/
public function edit($id = null)
{
$stateGroup = $this->StateGroups->get($id, [
'contain' => []
]);
if ($this->request->is(['patch', 'post', 'put'])) {
$stateGroup = $this->StateGroups->patchEntity($stateGroup, $this->request->getData());
if ($this->StateGroups->save($stateGroup)) {
$this->Flash->success(__('The state group has been saved.'));
return $this->redirect(['action' => 'index']);
}
$this->Flash->error(__('The state group could not be saved. Please, try again.'));
}
$indices = $this->StateGroups->Indices->find('list', ['limit' => 200]);
$this->set(compact('stateGroup', 'indices'));
}
/**
* Delete method
*
* @param string|null $id State Group id.
* @return \Cake\Http\Response|null Redirects to index.
* @throws \Cake\Datasource\Exception\RecordNotFoundException When record not found.
*/
public function delete($id = null)
{
$this->request->allowMethod(['post', 'delete']);
$stateGroup = $this->StateGroups->get($id);
if ($this->StateGroups->delete($stateGroup)) {
$this->Flash->success(__('The state group has been deleted.'));
} else {
$this->Flash->error(__('The state group could not be deleted. Please, try again.'));
}
return $this->redirect(['action' => 'index']);
}
}

View File

@ -0,0 +1,106 @@
<?php
namespace App\Controller;
use App\Controller\AppController;
/**
* StateRelationshipTypes Controller
*
* @property \App\Model\Table\StateRelationshipTypesTable $StateRelationshipTypes
*
* @method \App\Model\Entity\StateRelationshipType[]|\Cake\Datasource\ResultSetInterface paginate($object = null, array $settings = [])
*/
class StateRelationshipTypesController extends AppController
{
/**
* Index method
*
* @return \Cake\Http\Response|null
*/
public function index()
{
$stateRelationshipTypes = $this->paginate($this->StateRelationshipTypes);
$this->set(compact('stateRelationshipTypes'));
}
/**
* View method
*
* @param string|null $id State Relationship Type id.
* @return \Cake\Http\Response|null
* @throws \Cake\Datasource\Exception\RecordNotFoundException When record not found.
*/
public function view($id = null)
{
$stateRelationshipType = $this->StateRelationshipTypes->get($id, [
'contain' => []
]);
$this->set('stateRelationshipType', $stateRelationshipType);
}
/**
* Add method
*
* @return \Cake\Http\Response|null Redirects on successful add, renders view otherwise.
*/
public function add()
{
$stateRelationshipType = $this->StateRelationshipTypes->newEntity();
if ($this->request->is('post')) {
$stateRelationshipType = $this->StateRelationshipTypes->patchEntity($stateRelationshipType, $this->request->getData());
if ($this->StateRelationshipTypes->save($stateRelationshipType)) {
$this->Flash->success(__('The state relationship type has been saved.'));
return $this->redirect(['action' => 'index']);
}
$this->Flash->error(__('The state relationship type could not be saved. Please, try again.'));
}
$this->set(compact('stateRelationshipType'));
}
/**
* Edit method
*
* @param string|null $id State Relationship Type id.
* @return \Cake\Http\Response|null Redirects on successful edit, renders view otherwise.
* @throws \Cake\Datasource\Exception\RecordNotFoundException When record not found.
*/
public function edit($id = null)
{
$stateRelationshipType = $this->StateRelationshipTypes->get($id, [
'contain' => []
]);
if ($this->request->is(['patch', 'post', 'put'])) {
$stateRelationshipType = $this->StateRelationshipTypes->patchEntity($stateRelationshipType, $this->request->getData());
if ($this->StateRelationshipTypes->save($stateRelationshipType)) {
$this->Flash->success(__('The state relationship type has been saved.'));
return $this->redirect(['action' => 'index']);
}
$this->Flash->error(__('The state relationship type could not be saved. Please, try again.'));
}
$this->set(compact('stateRelationshipType'));
}
/**
* Delete method
*
* @param string|null $id State Relationship Type id.
* @return \Cake\Http\Response|null Redirects to index.
* @throws \Cake\Datasource\Exception\RecordNotFoundException When record not found.
*/
public function delete($id = null)
{
$this->request->allowMethod(['post', 'delete']);
$stateRelationshipType = $this->StateRelationshipTypes->get($id);
if ($this->StateRelationshipTypes->delete($stateRelationshipType)) {
$this->Flash->success(__('The state relationship type has been deleted.'));
} else {
$this->Flash->error(__('The state relationship type could not be deleted. Please, try again.'));
}
return $this->redirect(['action' => 'index']);
}
}

View File

@ -0,0 +1,113 @@
<?php
namespace App\Controller;
use App\Controller\AppController;
/**
* StateUsers Controller
*
* @property \App\Model\Table\StateUsersTable $StateUsers
*
* @method \App\Model\Entity\StateUser[]|\Cake\Datasource\ResultSetInterface paginate($object = null, array $settings = [])
*/
class StateUsersController extends AppController
{
/**
* Index method
*
* @return \Cake\Http\Response|null
*/
public function index()
{
$this->paginate = [
'contain' => ['Indices', 'StateGroups']
];
$stateUsers = $this->paginate($this->StateUsers);
$this->set(compact('stateUsers'));
}
/**
* View method
*
* @param string|null $id State User id.
* @return \Cake\Http\Response|null
* @throws \Cake\Datasource\Exception\RecordNotFoundException When record not found.
*/
public function view($id = null)
{
$stateUser = $this->StateUsers->get($id, [
'contain' => ['Indices', 'StateGroups', 'StateBalances', 'StateCreated', 'TransactionCreations', 'TransactionSendCoins']
]);
$this->set('stateUser', $stateUser);
}
/**
* Add method
*
* @return \Cake\Http\Response|null Redirects on successful add, renders view otherwise.
*/
public function add()
{
$stateUser = $this->StateUsers->newEntity();
if ($this->request->is('post')) {
$stateUser = $this->StateUsers->patchEntity($stateUser, $this->request->getData());
if ($this->StateUsers->save($stateUser)) {
$this->Flash->success(__('The state user has been saved.'));
return $this->redirect(['action' => 'index']);
}
$this->Flash->error(__('The state user could not be saved. Please, try again.'));
}
$indices = $this->StateUsers->Indices->find('list', ['limit' => 200]);
$stateGroups = $this->StateUsers->StateGroups->find('list', ['limit' => 200]);
$this->set(compact('stateUser', 'indices', 'stateGroups'));
}
/**
* Edit method
*
* @param string|null $id State User id.
* @return \Cake\Http\Response|null Redirects on successful edit, renders view otherwise.
* @throws \Cake\Datasource\Exception\RecordNotFoundException When record not found.
*/
public function edit($id = null)
{
$stateUser = $this->StateUsers->get($id, [
'contain' => []
]);
if ($this->request->is(['patch', 'post', 'put'])) {
$stateUser = $this->StateUsers->patchEntity($stateUser, $this->request->getData());
if ($this->StateUsers->save($stateUser)) {
$this->Flash->success(__('The state user has been saved.'));
return $this->redirect(['action' => 'index']);
}
$this->Flash->error(__('The state user could not be saved. Please, try again.'));
}
$indices = $this->StateUsers->Indices->find('list', ['limit' => 200]);
$stateGroups = $this->StateUsers->StateGroups->find('list', ['limit' => 200]);
$this->set(compact('stateUser', 'indices', 'stateGroups'));
}
/**
* Delete method
*
* @param string|null $id State User id.
* @return \Cake\Http\Response|null Redirects to index.
* @throws \Cake\Datasource\Exception\RecordNotFoundException When record not found.
*/
public function delete($id = null)
{
$this->request->allowMethod(['post', 'delete']);
$stateUser = $this->StateUsers->get($id);
if ($this->StateUsers->delete($stateUser)) {
$this->Flash->success(__('The state user has been deleted.'));
} else {
$this->Flash->error(__('The state user could not be deleted. Please, try again.'));
}
return $this->redirect(['action' => 'index']);
}
}

View File

@ -0,0 +1,113 @@
<?php
namespace App\Controller;
use App\Controller\AppController;
/**
* TransactionCreations Controller
*
* @property \App\Model\Table\TransactionCreationsTable $TransactionCreations
*
* @method \App\Model\Entity\TransactionCreation[]|\Cake\Datasource\ResultSetInterface paginate($object = null, array $settings = [])
*/
class TransactionCreationsController extends AppController
{
/**
* Index method
*
* @return \Cake\Http\Response|null
*/
public function index()
{
$this->paginate = [
'contain' => ['Transactions', 'StateUsers']
];
$transactionCreations = $this->paginate($this->TransactionCreations);
$this->set(compact('transactionCreations'));
}
/**
* View method
*
* @param string|null $id Transaction Creation id.
* @return \Cake\Http\Response|null
* @throws \Cake\Datasource\Exception\RecordNotFoundException When record not found.
*/
public function view($id = null)
{
$transactionCreation = $this->TransactionCreations->get($id, [
'contain' => ['Transactions', 'StateUsers']
]);
$this->set('transactionCreation', $transactionCreation);
}
/**
* Add method
*
* @return \Cake\Http\Response|null Redirects on successful add, renders view otherwise.
*/
public function add()
{
$transactionCreation = $this->TransactionCreations->newEntity();
if ($this->request->is('post')) {
$transactionCreation = $this->TransactionCreations->patchEntity($transactionCreation, $this->request->getData());
if ($this->TransactionCreations->save($transactionCreation)) {
$this->Flash->success(__('The transaction creation has been saved.'));
return $this->redirect(['action' => 'index']);
}
$this->Flash->error(__('The transaction creation could not be saved. Please, try again.'));
}
$transactions = $this->TransactionCreations->Transactions->find('list', ['limit' => 200]);
$stateUsers = $this->TransactionCreations->StateUsers->find('list', ['limit' => 200]);
$this->set(compact('transactionCreation', 'transactions', 'stateUsers'));
}
/**
* Edit method
*
* @param string|null $id Transaction Creation id.
* @return \Cake\Http\Response|null Redirects on successful edit, renders view otherwise.
* @throws \Cake\Datasource\Exception\RecordNotFoundException When record not found.
*/
public function edit($id = null)
{
$transactionCreation = $this->TransactionCreations->get($id, [
'contain' => []
]);
if ($this->request->is(['patch', 'post', 'put'])) {
$transactionCreation = $this->TransactionCreations->patchEntity($transactionCreation, $this->request->getData());
if ($this->TransactionCreations->save($transactionCreation)) {
$this->Flash->success(__('The transaction creation has been saved.'));
return $this->redirect(['action' => 'index']);
}
$this->Flash->error(__('The transaction creation could not be saved. Please, try again.'));
}
$transactions = $this->TransactionCreations->Transactions->find('list', ['limit' => 200]);
$stateUsers = $this->TransactionCreations->StateUsers->find('list', ['limit' => 200]);
$this->set(compact('transactionCreation', 'transactions', 'stateUsers'));
}
/**
* Delete method
*
* @param string|null $id Transaction Creation id.
* @return \Cake\Http\Response|null Redirects to index.
* @throws \Cake\Datasource\Exception\RecordNotFoundException When record not found.
*/
public function delete($id = null)
{
$this->request->allowMethod(['post', 'delete']);
$transactionCreation = $this->TransactionCreations->get($id);
if ($this->TransactionCreations->delete($transactionCreation)) {
$this->Flash->success(__('The transaction creation has been deleted.'));
} else {
$this->Flash->error(__('The transaction creation could not be deleted. Please, try again.'));
}
return $this->redirect(['action' => 'index']);
}
}

View File

@ -0,0 +1,113 @@
<?php
namespace App\Controller;
use App\Controller\AppController;
/**
* TransactionGroupAddaddress Controller
*
* @property \App\Model\Table\TransactionGroupAddaddressTable $TransactionGroupAddaddress
*
* @method \App\Model\Entity\TransactionGroupAddaddres[]|\Cake\Datasource\ResultSetInterface paginate($object = null, array $settings = [])
*/
class TransactionGroupAddaddressController extends AppController
{
/**
* Index method
*
* @return \Cake\Http\Response|null
*/
public function index()
{
$this->paginate = [
'contain' => ['Transactions', 'AddressTypes']
];
$transactionGroupAddaddress = $this->paginate($this->TransactionGroupAddaddress);
$this->set(compact('transactionGroupAddaddress'));
}
/**
* View method
*
* @param string|null $id Transaction Group Addaddres id.
* @return \Cake\Http\Response|null
* @throws \Cake\Datasource\Exception\RecordNotFoundException When record not found.
*/
public function view($id = null)
{
$transactionGroupAddaddres = $this->TransactionGroupAddaddress->get($id, [
'contain' => ['Transactions', 'AddressTypes']
]);
$this->set('transactionGroupAddaddres', $transactionGroupAddaddres);
}
/**
* Add method
*
* @return \Cake\Http\Response|null Redirects on successful add, renders view otherwise.
*/
public function add()
{
$transactionGroupAddaddres = $this->TransactionGroupAddaddress->newEntity();
if ($this->request->is('post')) {
$transactionGroupAddaddres = $this->TransactionGroupAddaddress->patchEntity($transactionGroupAddaddres, $this->request->getData());
if ($this->TransactionGroupAddaddress->save($transactionGroupAddaddres)) {
$this->Flash->success(__('The transaction group addaddres has been saved.'));
return $this->redirect(['action' => 'index']);
}
$this->Flash->error(__('The transaction group addaddres could not be saved. Please, try again.'));
}
$transactions = $this->TransactionGroupAddaddress->Transactions->find('list', ['limit' => 200]);
$addressTypes = $this->TransactionGroupAddaddress->AddressTypes->find('list', ['limit' => 200]);
$this->set(compact('transactionGroupAddaddres', 'transactions', 'addressTypes'));
}
/**
* Edit method
*
* @param string|null $id Transaction Group Addaddres id.
* @return \Cake\Http\Response|null Redirects on successful edit, renders view otherwise.
* @throws \Cake\Datasource\Exception\RecordNotFoundException When record not found.
*/
public function edit($id = null)
{
$transactionGroupAddaddres = $this->TransactionGroupAddaddress->get($id, [
'contain' => []
]);
if ($this->request->is(['patch', 'post', 'put'])) {
$transactionGroupAddaddres = $this->TransactionGroupAddaddress->patchEntity($transactionGroupAddaddres, $this->request->getData());
if ($this->TransactionGroupAddaddress->save($transactionGroupAddaddres)) {
$this->Flash->success(__('The transaction group addaddres has been saved.'));
return $this->redirect(['action' => 'index']);
}
$this->Flash->error(__('The transaction group addaddres could not be saved. Please, try again.'));
}
$transactions = $this->TransactionGroupAddaddress->Transactions->find('list', ['limit' => 200]);
$addressTypes = $this->TransactionGroupAddaddress->AddressTypes->find('list', ['limit' => 200]);
$this->set(compact('transactionGroupAddaddres', 'transactions', 'addressTypes'));
}
/**
* Delete method
*
* @param string|null $id Transaction Group Addaddres id.
* @return \Cake\Http\Response|null Redirects to index.
* @throws \Cake\Datasource\Exception\RecordNotFoundException When record not found.
*/
public function delete($id = null)
{
$this->request->allowMethod(['post', 'delete']);
$transactionGroupAddaddres = $this->TransactionGroupAddaddress->get($id);
if ($this->TransactionGroupAddaddress->delete($transactionGroupAddaddres)) {
$this->Flash->success(__('The transaction group addaddres has been deleted.'));
} else {
$this->Flash->error(__('The transaction group addaddres could not be deleted. Please, try again.'));
}
return $this->redirect(['action' => 'index']);
}
}

View File

@ -0,0 +1,113 @@
<?php
namespace App\Controller;
use App\Controller\AppController;
/**
* TransactionGroupAllowtrades Controller
*
* @property \App\Model\Table\TransactionGroupAllowtradesTable $TransactionGroupAllowtrades
*
* @method \App\Model\Entity\TransactionGroupAllowtrade[]|\Cake\Datasource\ResultSetInterface paginate($object = null, array $settings = [])
*/
class TransactionGroupAllowtradesController extends AppController
{
/**
* Index method
*
* @return \Cake\Http\Response|null
*/
public function index()
{
$this->paginate = [
'contain' => ['Transactions', 'Groups']
];
$transactionGroupAllowtrades = $this->paginate($this->TransactionGroupAllowtrades);
$this->set(compact('transactionGroupAllowtrades'));
}
/**
* View method
*
* @param string|null $id Transaction Group Allowtrade id.
* @return \Cake\Http\Response|null
* @throws \Cake\Datasource\Exception\RecordNotFoundException When record not found.
*/
public function view($id = null)
{
$transactionGroupAllowtrade = $this->TransactionGroupAllowtrades->get($id, [
'contain' => ['Transactions', 'Groups']
]);
$this->set('transactionGroupAllowtrade', $transactionGroupAllowtrade);
}
/**
* Add method
*
* @return \Cake\Http\Response|null Redirects on successful add, renders view otherwise.
*/
public function add()
{
$transactionGroupAllowtrade = $this->TransactionGroupAllowtrades->newEntity();
if ($this->request->is('post')) {
$transactionGroupAllowtrade = $this->TransactionGroupAllowtrades->patchEntity($transactionGroupAllowtrade, $this->request->getData());
if ($this->TransactionGroupAllowtrades->save($transactionGroupAllowtrade)) {
$this->Flash->success(__('The transaction group allowtrade has been saved.'));
return $this->redirect(['action' => 'index']);
}
$this->Flash->error(__('The transaction group allowtrade could not be saved. Please, try again.'));
}
$transactions = $this->TransactionGroupAllowtrades->Transactions->find('list', ['limit' => 200]);
$groups = $this->TransactionGroupAllowtrades->Groups->find('list', ['limit' => 200]);
$this->set(compact('transactionGroupAllowtrade', 'transactions', 'groups'));
}
/**
* Edit method
*
* @param string|null $id Transaction Group Allowtrade id.
* @return \Cake\Http\Response|null Redirects on successful edit, renders view otherwise.
* @throws \Cake\Datasource\Exception\RecordNotFoundException When record not found.
*/
public function edit($id = null)
{
$transactionGroupAllowtrade = $this->TransactionGroupAllowtrades->get($id, [
'contain' => []
]);
if ($this->request->is(['patch', 'post', 'put'])) {
$transactionGroupAllowtrade = $this->TransactionGroupAllowtrades->patchEntity($transactionGroupAllowtrade, $this->request->getData());
if ($this->TransactionGroupAllowtrades->save($transactionGroupAllowtrade)) {
$this->Flash->success(__('The transaction group allowtrade has been saved.'));
return $this->redirect(['action' => 'index']);
}
$this->Flash->error(__('The transaction group allowtrade could not be saved. Please, try again.'));
}
$transactions = $this->TransactionGroupAllowtrades->Transactions->find('list', ['limit' => 200]);
$groups = $this->TransactionGroupAllowtrades->Groups->find('list', ['limit' => 200]);
$this->set(compact('transactionGroupAllowtrade', 'transactions', 'groups'));
}
/**
* Delete method
*
* @param string|null $id Transaction Group Allowtrade id.
* @return \Cake\Http\Response|null Redirects to index.
* @throws \Cake\Datasource\Exception\RecordNotFoundException When record not found.
*/
public function delete($id = null)
{
$this->request->allowMethod(['post', 'delete']);
$transactionGroupAllowtrade = $this->TransactionGroupAllowtrades->get($id);
if ($this->TransactionGroupAllowtrades->delete($transactionGroupAllowtrade)) {
$this->Flash->success(__('The transaction group allowtrade has been deleted.'));
} else {
$this->Flash->error(__('The transaction group allowtrade could not be deleted. Please, try again.'));
}
return $this->redirect(['action' => 'index']);
}
}

View File

@ -0,0 +1,113 @@
<?php
namespace App\Controller;
use App\Controller\AppController;
/**
* TransactionGroupCreates Controller
*
* @property \App\Model\Table\TransactionGroupCreatesTable $TransactionGroupCreates
*
* @method \App\Model\Entity\TransactionGroupCreate[]|\Cake\Datasource\ResultSetInterface paginate($object = null, array $settings = [])
*/
class TransactionGroupCreatesController extends AppController
{
/**
* Index method
*
* @return \Cake\Http\Response|null
*/
public function index()
{
$this->paginate = [
'contain' => ['Transactions', 'StateGroups']
];
$transactionGroupCreates = $this->paginate($this->TransactionGroupCreates);
$this->set(compact('transactionGroupCreates'));
}
/**
* View method
*
* @param string|null $id Transaction Group Create id.
* @return \Cake\Http\Response|null
* @throws \Cake\Datasource\Exception\RecordNotFoundException When record not found.
*/
public function view($id = null)
{
$transactionGroupCreate = $this->TransactionGroupCreates->get($id, [
'contain' => ['Transactions', 'StateGroups']
]);
$this->set('transactionGroupCreate', $transactionGroupCreate);
}
/**
* Add method
*
* @return \Cake\Http\Response|null Redirects on successful add, renders view otherwise.
*/
public function add()
{
$transactionGroupCreate = $this->TransactionGroupCreates->newEntity();
if ($this->request->is('post')) {
$transactionGroupCreate = $this->TransactionGroupCreates->patchEntity($transactionGroupCreate, $this->request->getData());
if ($this->TransactionGroupCreates->save($transactionGroupCreate)) {
$this->Flash->success(__('The transaction group create has been saved.'));
return $this->redirect(['action' => 'index']);
}
$this->Flash->error(__('The transaction group create could not be saved. Please, try again.'));
}
$transactions = $this->TransactionGroupCreates->Transactions->find('list', ['limit' => 200]);
$stateGroups = $this->TransactionGroupCreates->StateGroups->find('list', ['limit' => 200]);
$this->set(compact('transactionGroupCreate', 'transactions', 'stateGroups'));
}
/**
* Edit method
*
* @param string|null $id Transaction Group Create id.
* @return \Cake\Http\Response|null Redirects on successful edit, renders view otherwise.
* @throws \Cake\Datasource\Exception\RecordNotFoundException When record not found.
*/
public function edit($id = null)
{
$transactionGroupCreate = $this->TransactionGroupCreates->get($id, [
'contain' => []
]);
if ($this->request->is(['patch', 'post', 'put'])) {
$transactionGroupCreate = $this->TransactionGroupCreates->patchEntity($transactionGroupCreate, $this->request->getData());
if ($this->TransactionGroupCreates->save($transactionGroupCreate)) {
$this->Flash->success(__('The transaction group create has been saved.'));
return $this->redirect(['action' => 'index']);
}
$this->Flash->error(__('The transaction group create could not be saved. Please, try again.'));
}
$transactions = $this->TransactionGroupCreates->Transactions->find('list', ['limit' => 200]);
$stateGroups = $this->TransactionGroupCreates->StateGroups->find('list', ['limit' => 200]);
$this->set(compact('transactionGroupCreate', 'transactions', 'stateGroups'));
}
/**
* Delete method
*
* @param string|null $id Transaction Group Create id.
* @return \Cake\Http\Response|null Redirects to index.
* @throws \Cake\Datasource\Exception\RecordNotFoundException When record not found.
*/
public function delete($id = null)
{
$this->request->allowMethod(['post', 'delete']);
$transactionGroupCreate = $this->TransactionGroupCreates->get($id);
if ($this->TransactionGroupCreates->delete($transactionGroupCreate)) {
$this->Flash->success(__('The transaction group create has been deleted.'));
} else {
$this->Flash->error(__('The transaction group create could not be deleted. Please, try again.'));
}
return $this->redirect(['action' => 'index']);
}
}

View File

@ -0,0 +1,115 @@
<?php
namespace App\Controller;
use App\Controller\AppController;
/**
* TransactionSendCoins Controller
*
* @property \App\Model\Table\TransactionSendCoinsTable $TransactionSendCoins
*
* @method \App\Model\Entity\TransactionSendCoin[]|\Cake\Datasource\ResultSetInterface paginate($object = null, array $settings = [])
*/
class TransactionSendCoinsController extends AppController
{
/**
* Index method
*
* @return \Cake\Http\Response|null
*/
public function index()
{
$this->paginate = [
'contain' => ['Transactions', 'StateUsers', 'ReceiverUsers']
];
$transactionSendCoins = $this->paginate($this->TransactionSendCoins);
$this->set(compact('transactionSendCoins'));
}
/**
* View method
*
* @param string|null $id Transaction Send Coin id.
* @return \Cake\Http\Response|null
* @throws \Cake\Datasource\Exception\RecordNotFoundException When record not found.
*/
public function view($id = null)
{
$transactionSendCoin = $this->TransactionSendCoins->get($id, [
'contain' => ['Transactions', 'StateUsers', 'ReceiverUsers']
]);
$this->set('transactionSendCoin', $transactionSendCoin);
}
/**
* Add method
*
* @return \Cake\Http\Response|null Redirects on successful add, renders view otherwise.
*/
public function add()
{
$transactionSendCoin = $this->TransactionSendCoins->newEntity();
if ($this->request->is('post')) {
$transactionSendCoin = $this->TransactionSendCoins->patchEntity($transactionSendCoin, $this->request->getData());
if ($this->TransactionSendCoins->save($transactionSendCoin)) {
$this->Flash->success(__('The transaction send coin has been saved.'));
return $this->redirect(['action' => 'index']);
}
$this->Flash->error(__('The transaction send coin could not be saved. Please, try again.'));
}
$transactions = $this->TransactionSendCoins->Transactions->find('list', ['limit' => 200]);
$stateUsers = $this->TransactionSendCoins->StateUsers->find('list', ['limit' => 200]);
$receiverUsers = $this->TransactionSendCoins->ReceiverUsers->find('list', ['limit' => 200]);
$this->set(compact('transactionSendCoin', 'transactions', 'stateUsers', 'receiverUsers'));
}
/**
* Edit method
*
* @param string|null $id Transaction Send Coin id.
* @return \Cake\Http\Response|null Redirects on successful edit, renders view otherwise.
* @throws \Cake\Datasource\Exception\RecordNotFoundException When record not found.
*/
public function edit($id = null)
{
$transactionSendCoin = $this->TransactionSendCoins->get($id, [
'contain' => []
]);
if ($this->request->is(['patch', 'post', 'put'])) {
$transactionSendCoin = $this->TransactionSendCoins->patchEntity($transactionSendCoin, $this->request->getData());
if ($this->TransactionSendCoins->save($transactionSendCoin)) {
$this->Flash->success(__('The transaction send coin has been saved.'));
return $this->redirect(['action' => 'index']);
}
$this->Flash->error(__('The transaction send coin could not be saved. Please, try again.'));
}
$transactions = $this->TransactionSendCoins->Transactions->find('list', ['limit' => 200]);
$stateUsers = $this->TransactionSendCoins->StateUsers->find('list', ['limit' => 200]);
$receiverUsers = $this->TransactionSendCoins->ReceiverUsers->find('list', ['limit' => 200]);
$this->set(compact('transactionSendCoin', 'transactions', 'stateUsers', 'receiverUsers'));
}
/**
* Delete method
*
* @param string|null $id Transaction Send Coin id.
* @return \Cake\Http\Response|null Redirects to index.
* @throws \Cake\Datasource\Exception\RecordNotFoundException When record not found.
*/
public function delete($id = null)
{
$this->request->allowMethod(['post', 'delete']);
$transactionSendCoin = $this->TransactionSendCoins->get($id);
if ($this->TransactionSendCoins->delete($transactionSendCoin)) {
$this->Flash->success(__('The transaction send coin has been deleted.'));
} else {
$this->Flash->error(__('The transaction send coin could not be deleted. Please, try again.'));
}
return $this->redirect(['action' => 'index']);
}
}

View File

@ -0,0 +1,111 @@
<?php
namespace App\Controller;
use App\Controller\AppController;
/**
* TransactionSignatures Controller
*
* @property \App\Model\Table\TransactionSignaturesTable $TransactionSignatures
*
* @method \App\Model\Entity\TransactionSignature[]|\Cake\Datasource\ResultSetInterface paginate($object = null, array $settings = [])
*/
class TransactionSignaturesController extends AppController
{
/**
* Index method
*
* @return \Cake\Http\Response|null
*/
public function index()
{
$this->paginate = [
'contain' => ['Transactions']
];
$transactionSignatures = $this->paginate($this->TransactionSignatures);
$this->set(compact('transactionSignatures'));
}
/**
* View method
*
* @param string|null $id Transaction Signature id.
* @return \Cake\Http\Response|null
* @throws \Cake\Datasource\Exception\RecordNotFoundException When record not found.
*/
public function view($id = null)
{
$transactionSignature = $this->TransactionSignatures->get($id, [
'contain' => ['Transactions']
]);
$this->set('transactionSignature', $transactionSignature);
}
/**
* Add method
*
* @return \Cake\Http\Response|null Redirects on successful add, renders view otherwise.
*/
public function add()
{
$transactionSignature = $this->TransactionSignatures->newEntity();
if ($this->request->is('post')) {
$transactionSignature = $this->TransactionSignatures->patchEntity($transactionSignature, $this->request->getData());
if ($this->TransactionSignatures->save($transactionSignature)) {
$this->Flash->success(__('The transaction signature has been saved.'));
return $this->redirect(['action' => 'index']);
}
$this->Flash->error(__('The transaction signature could not be saved. Please, try again.'));
}
$transactions = $this->TransactionSignatures->Transactions->find('list', ['limit' => 200]);
$this->set(compact('transactionSignature', 'transactions'));
}
/**
* Edit method
*
* @param string|null $id Transaction Signature id.
* @return \Cake\Http\Response|null Redirects on successful edit, renders view otherwise.
* @throws \Cake\Datasource\Exception\RecordNotFoundException When record not found.
*/
public function edit($id = null)
{
$transactionSignature = $this->TransactionSignatures->get($id, [
'contain' => []
]);
if ($this->request->is(['patch', 'post', 'put'])) {
$transactionSignature = $this->TransactionSignatures->patchEntity($transactionSignature, $this->request->getData());
if ($this->TransactionSignatures->save($transactionSignature)) {
$this->Flash->success(__('The transaction signature has been saved.'));
return $this->redirect(['action' => 'index']);
}
$this->Flash->error(__('The transaction signature could not be saved. Please, try again.'));
}
$transactions = $this->TransactionSignatures->Transactions->find('list', ['limit' => 200]);
$this->set(compact('transactionSignature', 'transactions'));
}
/**
* Delete method
*
* @param string|null $id Transaction Signature id.
* @return \Cake\Http\Response|null Redirects to index.
* @throws \Cake\Datasource\Exception\RecordNotFoundException When record not found.
*/
public function delete($id = null)
{
$this->request->allowMethod(['post', 'delete']);
$transactionSignature = $this->TransactionSignatures->get($id);
if ($this->TransactionSignatures->delete($transactionSignature)) {
$this->Flash->success(__('The transaction signature has been deleted.'));
} else {
$this->Flash->error(__('The transaction signature could not be deleted. Please, try again.'));
}
return $this->redirect(['action' => 'index']);
}
}

View File

@ -0,0 +1,106 @@
<?php
namespace App\Controller;
use App\Controller\AppController;
/**
* TransactionTypes Controller
*
* @property \App\Model\Table\TransactionTypesTable $TransactionTypes
*
* @method \App\Model\Entity\TransactionType[]|\Cake\Datasource\ResultSetInterface paginate($object = null, array $settings = [])
*/
class TransactionTypesController extends AppController
{
/**
* Index method
*
* @return \Cake\Http\Response|null
*/
public function index()
{
$transactionTypes = $this->paginate($this->TransactionTypes);
$this->set(compact('transactionTypes'));
}
/**
* View method
*
* @param string|null $id Transaction Type id.
* @return \Cake\Http\Response|null
* @throws \Cake\Datasource\Exception\RecordNotFoundException When record not found.
*/
public function view($id = null)
{
$transactionType = $this->TransactionTypes->get($id, [
'contain' => ['Transactions']
]);
$this->set('transactionType', $transactionType);
}
/**
* Add method
*
* @return \Cake\Http\Response|null Redirects on successful add, renders view otherwise.
*/
public function add()
{
$transactionType = $this->TransactionTypes->newEntity();
if ($this->request->is('post')) {
$transactionType = $this->TransactionTypes->patchEntity($transactionType, $this->request->getData());
if ($this->TransactionTypes->save($transactionType)) {
$this->Flash->success(__('The transaction type has been saved.'));
return $this->redirect(['action' => 'index']);
}
$this->Flash->error(__('The transaction type could not be saved. Please, try again.'));
}
$this->set(compact('transactionType'));
}
/**
* Edit method
*
* @param string|null $id Transaction Type id.
* @return \Cake\Http\Response|null Redirects on successful edit, renders view otherwise.
* @throws \Cake\Datasource\Exception\RecordNotFoundException When record not found.
*/
public function edit($id = null)
{
$transactionType = $this->TransactionTypes->get($id, [
'contain' => []
]);
if ($this->request->is(['patch', 'post', 'put'])) {
$transactionType = $this->TransactionTypes->patchEntity($transactionType, $this->request->getData());
if ($this->TransactionTypes->save($transactionType)) {
$this->Flash->success(__('The transaction type has been saved.'));
return $this->redirect(['action' => 'index']);
}
$this->Flash->error(__('The transaction type could not be saved. Please, try again.'));
}
$this->set(compact('transactionType'));
}
/**
* Delete method
*
* @param string|null $id Transaction Type id.
* @return \Cake\Http\Response|null Redirects to index.
* @throws \Cake\Datasource\Exception\RecordNotFoundException When record not found.
*/
public function delete($id = null)
{
$this->request->allowMethod(['post', 'delete']);
$transactionType = $this->TransactionTypes->get($id);
if ($this->TransactionTypes->delete($transactionType)) {
$this->Flash->success(__('The transaction type has been deleted.'));
} else {
$this->Flash->error(__('The transaction type could not be deleted. Please, try again.'));
}
return $this->redirect(['action' => 'index']);
}
}

View File

@ -0,0 +1,113 @@
<?php
namespace App\Controller;
use App\Controller\AppController;
/**
* Transactions Controller
*
* @property \App\Model\Table\TransactionsTable $Transactions
*
* @method \App\Model\Entity\Transaction[]|\Cake\Datasource\ResultSetInterface paginate($object = null, array $settings = [])
*/
class TransactionsController extends AppController
{
/**
* Index method
*
* @return \Cake\Http\Response|null
*/
public function index()
{
$this->paginate = [
'contain' => ['StateGroups', 'TransactionTypes']
];
$transactions = $this->paginate($this->Transactions);
$this->set(compact('transactions'));
}
/**
* View method
*
* @param string|null $id Transaction id.
* @return \Cake\Http\Response|null
* @throws \Cake\Datasource\Exception\RecordNotFoundException When record not found.
*/
public function view($id = null)
{
$transaction = $this->Transactions->get($id, [
'contain' => ['StateGroups', 'TransactionTypes', 'StateCreated', 'TransactionCreations', 'TransactionGroupAddaddress', 'TransactionGroupAllowtrades', 'TransactionGroupCreates', 'TransactionSendCoins', 'TransactionSignatures']
]);
$this->set('transaction', $transaction);
}
/**
* Add method
*
* @return \Cake\Http\Response|null Redirects on successful add, renders view otherwise.
*/
public function add()
{
$transaction = $this->Transactions->newEntity();
if ($this->request->is('post')) {
$transaction = $this->Transactions->patchEntity($transaction, $this->request->getData());
if ($this->Transactions->save($transaction)) {
$this->Flash->success(__('The transaction has been saved.'));
return $this->redirect(['action' => 'index']);
}
$this->Flash->error(__('The transaction could not be saved. Please, try again.'));
}
$stateGroups = $this->Transactions->StateGroups->find('list', ['limit' => 200]);
$transactionTypes = $this->Transactions->TransactionTypes->find('list', ['limit' => 200]);
$this->set(compact('transaction', 'stateGroups', 'transactionTypes'));
}
/**
* Edit method
*
* @param string|null $id Transaction id.
* @return \Cake\Http\Response|null Redirects on successful edit, renders view otherwise.
* @throws \Cake\Datasource\Exception\RecordNotFoundException When record not found.
*/
public function edit($id = null)
{
$transaction = $this->Transactions->get($id, [
'contain' => []
]);
if ($this->request->is(['patch', 'post', 'put'])) {
$transaction = $this->Transactions->patchEntity($transaction, $this->request->getData());
if ($this->Transactions->save($transaction)) {
$this->Flash->success(__('The transaction has been saved.'));
return $this->redirect(['action' => 'index']);
}
$this->Flash->error(__('The transaction could not be saved. Please, try again.'));
}
$stateGroups = $this->Transactions->StateGroups->find('list', ['limit' => 200]);
$transactionTypes = $this->Transactions->TransactionTypes->find('list', ['limit' => 200]);
$this->set(compact('transaction', 'stateGroups', 'transactionTypes'));
}
/**
* Delete method
*
* @param string|null $id Transaction id.
* @return \Cake\Http\Response|null Redirects to index.
* @throws \Cake\Datasource\Exception\RecordNotFoundException When record not found.
*/
public function delete($id = null)
{
$this->request->allowMethod(['post', 'delete']);
$transaction = $this->Transactions->get($id);
if ($this->Transactions->delete($transaction)) {
$this->Flash->success(__('The transaction has been deleted.'));
} else {
$this->Flash->error(__('The transaction could not be deleted. Please, try again.'));
}
return $this->redirect(['action' => 'index']);
}
}

0
src/Model/Behavior/empty Normal file
View File

View File

@ -0,0 +1,33 @@
<?php
namespace App\Model\Entity;
use Cake\ORM\Entity;
/**
* AddressType Entity
*
* @property int $id
* @property string $name
* @property string|null $text
*
* @property \App\Model\Entity\StateGroupAddress[] $state_group_addresses
* @property \App\Model\Entity\TransactionGroupAddaddres[] $transaction_group_addaddress
*/
class AddressType extends Entity
{
/**
* Fields that can be mass assigned using newEntity() or patchEntity().
*
* Note that when '*' is set to true, this allows all unspecified fields to
* be mass assigned. For security purposes, it is advised to set '*' to false
* (or remove it), and explicitly make individual fields accessible as needed.
*
* @var array
*/
protected $_accessible = [
'name' => true,
'text' => true,
'state_group_addresses' => true,
'transaction_group_addaddress' => true
];
}

View File

@ -0,0 +1,28 @@
<?php
namespace App\Model\Entity;
use Cake\ORM\Entity;
/**
* Operator Entity
*
* @property int $id
* @property string $username
* @property string $data_base64
*/
class Operator extends Entity
{
/**
* Fields that can be mass assigned using newEntity() or patchEntity().
*
* Note that when '*' is set to true, this allows all unspecified fields to
* be mass assigned. For security purposes, it is advised to set '*' to false
* (or remove it), and explicitly make individual fields accessible as needed.
*
* @var array
*/
protected $_accessible = [
'username' => true,
'data_base64' => true
];
}

View File

@ -0,0 +1,33 @@
<?php
namespace App\Model\Entity;
use Cake\ORM\Entity;
/**
* StateBalance Entity
*
* @property int $id
* @property int $state_user_id
* @property \Cake\I18n\FrozenTime $modified
* @property int $amount
*
* @property \App\Model\Entity\StateUser $state_user
*/
class StateBalance extends Entity
{
/**
* Fields that can be mass assigned using newEntity() or patchEntity().
*
* Note that when '*' is set to true, this allows all unspecified fields to
* be mass assigned. For security purposes, it is advised to set '*' to false
* (or remove it), and explicitly make individual fields accessible as needed.
*
* @var array
*/
protected $_accessible = [
'state_user_id' => true,
'modified' => true,
'amount' => true,
'state_user' => true
];
}

View File

@ -0,0 +1,41 @@
<?php
namespace App\Model\Entity;
use Cake\ORM\Entity;
/**
* StateCreated Entity
*
* @property int $id
* @property int $transaction_id
* @property int $month
* @property int $year
* @property int $state_user_id
* @property \Cake\I18n\FrozenTime $created
* @property int $short_ident_hash
*
* @property \App\Model\Entity\Transaction $transaction
* @property \App\Model\Entity\StateUser $state_user
*/
class StateCreated extends Entity
{
/**
* Fields that can be mass assigned using newEntity() or patchEntity().
*
* Note that when '*' is set to true, this allows all unspecified fields to
* be mass assigned. For security purposes, it is advised to set '*' to false
* (or remove it), and explicitly make individual fields accessible as needed.
*
* @var array
*/
protected $_accessible = [
'transaction_id' => true,
'month' => true,
'year' => true,
'state_user_id' => true,
'created' => true,
'short_ident_hash' => true,
'transaction' => true,
'state_user' => true
];
}

View File

@ -0,0 +1,43 @@
<?php
namespace App\Model\Entity;
use Cake\ORM\Entity;
/**
* StateGroup Entity
*
* @property int $id
* @property string|resource $index_id
* @property string $name
* @property string|resource $root_public_key
* @property int $user_count
*
* @property \App\Model\Entity\Index $index
* @property \App\Model\Entity\StateGroupAddress[] $state_group_addresses
* @property \App\Model\Entity\StateUser[] $state_users
* @property \App\Model\Entity\TransactionGroupCreate[] $transaction_group_creates
* @property \App\Model\Entity\Transaction[] $transactions
*/
class StateGroup extends Entity
{
/**
* Fields that can be mass assigned using newEntity() or patchEntity().
*
* Note that when '*' is set to true, this allows all unspecified fields to
* be mass assigned. For security purposes, it is advised to set '*' to false
* (or remove it), and explicitly make individual fields accessible as needed.
*
* @var array
*/
protected $_accessible = [
'index_id' => true,
'name' => true,
'root_public_key' => true,
'user_count' => true,
'index' => true,
'state_group_addresses' => true,
'state_users' => true,
'transaction_group_creates' => true,
'transactions' => true
];
}

View File

@ -0,0 +1,35 @@
<?php
namespace App\Model\Entity;
use Cake\ORM\Entity;
/**
* StateGroupAddress Entity
*
* @property int $id
* @property int $state_group_id
* @property string|resource $public_key
* @property int $address_type_id
*
* @property \App\Model\Entity\StateGroup $state_group
* @property \App\Model\Entity\AddressType $address_type
*/
class StateGroupAddress extends Entity
{
/**
* Fields that can be mass assigned using newEntity() or patchEntity().
*
* Note that when '*' is set to true, this allows all unspecified fields to
* be mass assigned. For security purposes, it is advised to set '*' to false
* (or remove it), and explicitly make individual fields accessible as needed.
*
* @var array
*/
protected $_accessible = [
'state_group_id' => true,
'public_key' => true,
'address_type_id' => true,
'state_group' => true,
'address_type' => true
];
}

View File

@ -0,0 +1,37 @@
<?php
namespace App\Model\Entity;
use Cake\ORM\Entity;
/**
* StateGroupRelationship Entity
*
* @property int $id
* @property int $state_group1_id
* @property int $state_group2_id
* @property int $state_relationship_id
*
* @property \App\Model\Entity\StateGroup1 $state_group1
* @property \App\Model\Entity\StateGroup2 $state_group2
* @property \App\Model\Entity\StateRelationship $state_relationship
*/
class StateGroupRelationship extends Entity
{
/**
* Fields that can be mass assigned using newEntity() or patchEntity().
*
* Note that when '*' is set to true, this allows all unspecified fields to
* be mass assigned. For security purposes, it is advised to set '*' to false
* (or remove it), and explicitly make individual fields accessible as needed.
*
* @var array
*/
protected $_accessible = [
'state_group1_id' => true,
'state_group2_id' => true,
'state_relationship_id' => true,
'state_group1' => true,
'state_group2' => true,
'state_relationship' => true
];
}

View File

@ -0,0 +1,28 @@
<?php
namespace App\Model\Entity;
use Cake\ORM\Entity;
/**
* StateRelationshipType Entity
*
* @property int $id
* @property string $name
* @property string|null $text
*/
class StateRelationshipType extends Entity
{
/**
* Fields that can be mass assigned using newEntity() or patchEntity().
*
* Note that when '*' is set to true, this allows all unspecified fields to
* be mass assigned. For security purposes, it is advised to set '*' to false
* (or remove it), and explicitly make individual fields accessible as needed.
*
* @var array
*/
protected $_accessible = [
'name' => true,
'text' => true
];
}

View File

@ -0,0 +1,43 @@
<?php
namespace App\Model\Entity;
use Cake\ORM\Entity;
/**
* StateUser Entity
*
* @property int $id
* @property int $index_id
* @property int $state_group_id
* @property string|resource $public_key
*
* @property \App\Model\Entity\Index $index
* @property \App\Model\Entity\StateGroup $state_group
* @property \App\Model\Entity\StateBalance[] $state_balances
* @property \App\Model\Entity\StateCreated[] $state_created
* @property \App\Model\Entity\TransactionCreation[] $transaction_creations
* @property \App\Model\Entity\TransactionSendCoin[] $transaction_send_coins
*/
class StateUser extends Entity
{
/**
* Fields that can be mass assigned using newEntity() or patchEntity().
*
* Note that when '*' is set to true, this allows all unspecified fields to
* be mass assigned. For security purposes, it is advised to set '*' to false
* (or remove it), and explicitly make individual fields accessible as needed.
*
* @var array
*/
protected $_accessible = [
'index_id' => true,
'state_group_id' => true,
'public_key' => true,
'index' => true,
'state_group' => true,
'state_balances' => true,
'state_created' => true,
'transaction_creations' => true,
'transaction_send_coins' => true
];
}

View File

@ -0,0 +1,51 @@
<?php
namespace App\Model\Entity;
use Cake\ORM\Entity;
/**
* Transaction Entity
*
* @property int $id
* @property int $state_group_id
* @property int $transaction_type_id
* @property string|resource $tx_hash
* @property \Cake\I18n\FrozenTime $received
*
* @property \App\Model\Entity\StateGroup $state_group
* @property \App\Model\Entity\TransactionType $transaction_type
* @property \App\Model\Entity\StateCreated[] $state_created
* @property \App\Model\Entity\TransactionCreation[] $transaction_creations
* @property \App\Model\Entity\TransactionGroupAddaddres[] $transaction_group_addaddress
* @property \App\Model\Entity\TransactionGroupAllowtrade[] $transaction_group_allowtrades
* @property \App\Model\Entity\TransactionGroupCreate[] $transaction_group_creates
* @property \App\Model\Entity\TransactionSendCoin[] $transaction_send_coins
* @property \App\Model\Entity\TransactionSignature[] $transaction_signatures
*/
class Transaction extends Entity
{
/**
* Fields that can be mass assigned using newEntity() or patchEntity().
*
* Note that when '*' is set to true, this allows all unspecified fields to
* be mass assigned. For security purposes, it is advised to set '*' to false
* (or remove it), and explicitly make individual fields accessible as needed.
*
* @var array
*/
protected $_accessible = [
'state_group_id' => true,
'transaction_type_id' => true,
'tx_hash' => true,
'received' => true,
'state_group' => true,
'transaction_type' => true,
'state_created' => true,
'transaction_creations' => true,
'transaction_group_addaddress' => true,
'transaction_group_allowtrades' => true,
'transaction_group_creates' => true,
'transaction_send_coins' => true,
'transaction_signatures' => true
];
}

View File

@ -0,0 +1,37 @@
<?php
namespace App\Model\Entity;
use Cake\ORM\Entity;
/**
* TransactionCreation Entity
*
* @property int $id
* @property int $transaction_id
* @property int $state_user_id
* @property int $amount
* @property string|resource $ident_hash
*
* @property \App\Model\Entity\Transaction $transaction
* @property \App\Model\Entity\StateUser $state_user
*/
class TransactionCreation extends Entity
{
/**
* Fields that can be mass assigned using newEntity() or patchEntity().
*
* Note that when '*' is set to true, this allows all unspecified fields to
* be mass assigned. For security purposes, it is advised to set '*' to false
* (or remove it), and explicitly make individual fields accessible as needed.
*
* @var array
*/
protected $_accessible = [
'transaction_id' => true,
'state_user_id' => true,
'amount' => true,
'ident_hash' => true,
'transaction' => true,
'state_user' => true
];
}

View File

@ -0,0 +1,35 @@
<?php
namespace App\Model\Entity;
use Cake\ORM\Entity;
/**
* TransactionGroupAddaddres Entity
*
* @property int $id
* @property int $transaction_id
* @property int $address_type_id
* @property string|resource $public_key
*
* @property \App\Model\Entity\Transaction $transaction
* @property \App\Model\Entity\AddressType $address_type
*/
class TransactionGroupAddaddres extends Entity
{
/**
* Fields that can be mass assigned using newEntity() or patchEntity().
*
* Note that when '*' is set to true, this allows all unspecified fields to
* be mass assigned. For security purposes, it is advised to set '*' to false
* (or remove it), and explicitly make individual fields accessible as needed.
*
* @var array
*/
protected $_accessible = [
'transaction_id' => true,
'address_type_id' => true,
'public_key' => true,
'transaction' => true,
'address_type' => true
];
}

View File

@ -0,0 +1,35 @@
<?php
namespace App\Model\Entity;
use Cake\ORM\Entity;
/**
* TransactionGroupAllowtrade Entity
*
* @property int $id
* @property int $transaction_id
* @property int $group_id
* @property bool $allow
*
* @property \App\Model\Entity\Transaction $transaction
* @property \App\Model\Entity\Group $group
*/
class TransactionGroupAllowtrade extends Entity
{
/**
* Fields that can be mass assigned using newEntity() or patchEntity().
*
* Note that when '*' is set to true, this allows all unspecified fields to
* be mass assigned. For security purposes, it is advised to set '*' to false
* (or remove it), and explicitly make individual fields accessible as needed.
*
* @var array
*/
protected $_accessible = [
'transaction_id' => true,
'group_id' => true,
'allow' => true,
'transaction' => true,
'group' => true
];
}

View File

@ -0,0 +1,37 @@
<?php
namespace App\Model\Entity;
use Cake\ORM\Entity;
/**
* TransactionGroupCreate Entity
*
* @property int $id
* @property int $transaction_id
* @property string|resource $group_public_key
* @property int $state_group_id
* @property string $name
*
* @property \App\Model\Entity\Transaction $transaction
* @property \App\Model\Entity\StateGroup $state_group
*/
class TransactionGroupCreate extends Entity
{
/**
* Fields that can be mass assigned using newEntity() or patchEntity().
*
* Note that when '*' is set to true, this allows all unspecified fields to
* be mass assigned. For security purposes, it is advised to set '*' to false
* (or remove it), and explicitly make individual fields accessible as needed.
*
* @var array
*/
protected $_accessible = [
'transaction_id' => true,
'group_public_key' => true,
'state_group_id' => true,
'name' => true,
'transaction' => true,
'state_group' => true
];
}

View File

@ -0,0 +1,43 @@
<?php
namespace App\Model\Entity;
use Cake\ORM\Entity;
/**
* TransactionSendCoin Entity
*
* @property int $id
* @property int $transaction_id
* @property int $state_user_id
* @property string|resource $receiver_public_key
* @property string|resource $receiver_user_id
* @property int $amount
* @property int $sender_final_balance
*
* @property \App\Model\Entity\Transaction $transaction
* @property \App\Model\Entity\StateUser $state_user
* @property \App\Model\Entity\ReceiverUser $receiver_user
*/
class TransactionSendCoin extends Entity
{
/**
* Fields that can be mass assigned using newEntity() or patchEntity().
*
* Note that when '*' is set to true, this allows all unspecified fields to
* be mass assigned. For security purposes, it is advised to set '*' to false
* (or remove it), and explicitly make individual fields accessible as needed.
*
* @var array
*/
protected $_accessible = [
'transaction_id' => true,
'state_user_id' => true,
'receiver_public_key' => true,
'receiver_user_id' => true,
'amount' => true,
'sender_final_balance' => true,
'transaction' => true,
'state_user' => true,
'receiver_user' => true
];
}

View File

@ -0,0 +1,33 @@
<?php
namespace App\Model\Entity;
use Cake\ORM\Entity;
/**
* TransactionSignature Entity
*
* @property int $id
* @property int $transaction_id
* @property string|resource $signature
* @property string|resource $pubkey
*
* @property \App\Model\Entity\Transaction $transaction
*/
class TransactionSignature extends Entity
{
/**
* Fields that can be mass assigned using newEntity() or patchEntity().
*
* Note that when '*' is set to true, this allows all unspecified fields to
* be mass assigned. For security purposes, it is advised to set '*' to false
* (or remove it), and explicitly make individual fields accessible as needed.
*
* @var array
*/
protected $_accessible = [
'transaction_id' => true,
'signature' => true,
'pubkey' => true,
'transaction' => true
];
}

View File

@ -0,0 +1,31 @@
<?php
namespace App\Model\Entity;
use Cake\ORM\Entity;
/**
* TransactionType Entity
*
* @property int $id
* @property string $name
* @property string|null $text
*
* @property \App\Model\Entity\Transaction[] $transactions
*/
class TransactionType extends Entity
{
/**
* Fields that can be mass assigned using newEntity() or patchEntity().
*
* Note that when '*' is set to true, this allows all unspecified fields to
* be mass assigned. For security purposes, it is advised to set '*' to false
* (or remove it), and explicitly make individual fields accessible as needed.
*
* @var array
*/
protected $_accessible = [
'name' => true,
'text' => true,
'transactions' => true
];
}

View File

@ -0,0 +1,73 @@
<?php
namespace App\Model\Table;
use Cake\ORM\Query;
use Cake\ORM\RulesChecker;
use Cake\ORM\Table;
use Cake\Validation\Validator;
/**
* AddressTypes Model
*
* @property \App\Model\Table\StateGroupAddressesTable&\Cake\ORM\Association\HasMany $StateGroupAddresses
* @property \App\Model\Table\TransactionGroupAddaddressTable&\Cake\ORM\Association\HasMany $TransactionGroupAddaddress
*
* @method \App\Model\Entity\AddressType get($primaryKey, $options = [])
* @method \App\Model\Entity\AddressType newEntity($data = null, array $options = [])
* @method \App\Model\Entity\AddressType[] newEntities(array $data, array $options = [])
* @method \App\Model\Entity\AddressType|false save(\Cake\Datasource\EntityInterface $entity, $options = [])
* @method \App\Model\Entity\AddressType saveOrFail(\Cake\Datasource\EntityInterface $entity, $options = [])
* @method \App\Model\Entity\AddressType patchEntity(\Cake\Datasource\EntityInterface $entity, array $data, array $options = [])
* @method \App\Model\Entity\AddressType[] patchEntities($entities, array $data, array $options = [])
* @method \App\Model\Entity\AddressType findOrCreate($search, callable $callback = null, $options = [])
*/
class AddressTypesTable extends Table
{
/**
* Initialize method
*
* @param array $config The configuration for the Table.
* @return void
*/
public function initialize(array $config)
{
parent::initialize($config);
$this->setTable('address_types');
$this->setDisplayField('name');
$this->setPrimaryKey('id');
$this->hasMany('StateGroupAddresses', [
'foreignKey' => 'address_type_id'
]);
$this->hasMany('TransactionGroupAddaddress', [
'foreignKey' => 'address_type_id'
]);
}
/**
* Default validation rules.
*
* @param \Cake\Validation\Validator $validator Validator instance.
* @return \Cake\Validation\Validator
*/
public function validationDefault(Validator $validator)
{
$validator
->integer('id')
->allowEmptyString('id', null, 'create');
$validator
->scalar('name')
->maxLength('name', 25)
->requirePresence('name', 'create')
->notEmptyString('name');
$validator
->scalar('text')
->maxLength('text', 255)
->allowEmptyString('text');
return $validator;
}
}

View File

@ -0,0 +1,79 @@
<?php
namespace App\Model\Table;
use Cake\ORM\Query;
use Cake\ORM\RulesChecker;
use Cake\ORM\Table;
use Cake\Validation\Validator;
/**
* Operators Model
*
* @method \App\Model\Entity\Operator get($primaryKey, $options = [])
* @method \App\Model\Entity\Operator newEntity($data = null, array $options = [])
* @method \App\Model\Entity\Operator[] newEntities(array $data, array $options = [])
* @method \App\Model\Entity\Operator|false save(\Cake\Datasource\EntityInterface $entity, $options = [])
* @method \App\Model\Entity\Operator saveOrFail(\Cake\Datasource\EntityInterface $entity, $options = [])
* @method \App\Model\Entity\Operator patchEntity(\Cake\Datasource\EntityInterface $entity, array $data, array $options = [])
* @method \App\Model\Entity\Operator[] patchEntities($entities, array $data, array $options = [])
* @method \App\Model\Entity\Operator findOrCreate($search, callable $callback = null, $options = [])
*/
class OperatorsTable extends Table
{
/**
* Initialize method
*
* @param array $config The configuration for the Table.
* @return void
*/
public function initialize(array $config)
{
parent::initialize($config);
$this->setTable('operators');
$this->setDisplayField('id');
$this->setPrimaryKey('id');
}
/**
* Default validation rules.
*
* @param \Cake\Validation\Validator $validator Validator instance.
* @return \Cake\Validation\Validator
*/
public function validationDefault(Validator $validator)
{
$validator
->integer('id')
->allowEmptyString('id', null, 'create');
$validator
->scalar('username')
->maxLength('username', 128)
->requirePresence('username', 'create')
->notEmptyString('username')
->add('username', 'unique', ['rule' => 'validateUnique', 'provider' => 'table']);
$validator
->scalar('data_base64')
->maxLength('data_base64', 255)
->requirePresence('data_base64', 'create')
->notEmptyString('data_base64');
return $validator;
}
/**
* Returns a rules checker object that will be used for validating
* application integrity.
*
* @param \Cake\ORM\RulesChecker $rules The rules object to be modified.
* @return \Cake\ORM\RulesChecker
*/
public function buildRules(RulesChecker $rules)
{
$rules->add($rules->isUnique(['username']));
return $rules;
}
}

View File

@ -0,0 +1,81 @@
<?php
namespace App\Model\Table;
use Cake\ORM\Query;
use Cake\ORM\RulesChecker;
use Cake\ORM\Table;
use Cake\Validation\Validator;
/**
* StateBalances Model
*
* @property \App\Model\Table\StateUsersTable&\Cake\ORM\Association\BelongsTo $StateUsers
*
* @method \App\Model\Entity\StateBalance get($primaryKey, $options = [])
* @method \App\Model\Entity\StateBalance newEntity($data = null, array $options = [])
* @method \App\Model\Entity\StateBalance[] newEntities(array $data, array $options = [])
* @method \App\Model\Entity\StateBalance|false save(\Cake\Datasource\EntityInterface $entity, $options = [])
* @method \App\Model\Entity\StateBalance saveOrFail(\Cake\Datasource\EntityInterface $entity, $options = [])
* @method \App\Model\Entity\StateBalance patchEntity(\Cake\Datasource\EntityInterface $entity, array $data, array $options = [])
* @method \App\Model\Entity\StateBalance[] patchEntities($entities, array $data, array $options = [])
* @method \App\Model\Entity\StateBalance findOrCreate($search, callable $callback = null, $options = [])
*
* @mixin \Cake\ORM\Behavior\TimestampBehavior
*/
class StateBalancesTable extends Table
{
/**
* Initialize method
*
* @param array $config The configuration for the Table.
* @return void
*/
public function initialize(array $config)
{
parent::initialize($config);
$this->setTable('state_balances');
$this->setDisplayField('id');
$this->setPrimaryKey('id');
$this->addBehavior('Timestamp');
$this->belongsTo('StateUsers', [
'foreignKey' => 'state_user_id',
'joinType' => 'INNER'
]);
}
/**
* Default validation rules.
*
* @param \Cake\Validation\Validator $validator Validator instance.
* @return \Cake\Validation\Validator
*/
public function validationDefault(Validator $validator)
{
$validator
->integer('id')
->allowEmptyString('id', null, 'create');
$validator
->requirePresence('amount', 'create')
->notEmptyString('amount');
return $validator;
}
/**
* Returns a rules checker object that will be used for validating
* application integrity.
*
* @param \Cake\ORM\RulesChecker $rules The rules object to be modified.
* @return \Cake\ORM\RulesChecker
*/
public function buildRules(RulesChecker $rules)
{
$rules->add($rules->existsIn(['state_user_id'], 'StateUsers'));
return $rules;
}
}

View File

@ -0,0 +1,96 @@
<?php
namespace App\Model\Table;
use Cake\ORM\Query;
use Cake\ORM\RulesChecker;
use Cake\ORM\Table;
use Cake\Validation\Validator;
/**
* StateCreated Model
*
* @property \App\Model\Table\TransactionsTable&\Cake\ORM\Association\BelongsTo $Transactions
* @property \App\Model\Table\StateUsersTable&\Cake\ORM\Association\BelongsTo $StateUsers
*
* @method \App\Model\Entity\StateCreated get($primaryKey, $options = [])
* @method \App\Model\Entity\StateCreated newEntity($data = null, array $options = [])
* @method \App\Model\Entity\StateCreated[] newEntities(array $data, array $options = [])
* @method \App\Model\Entity\StateCreated|false save(\Cake\Datasource\EntityInterface $entity, $options = [])
* @method \App\Model\Entity\StateCreated saveOrFail(\Cake\Datasource\EntityInterface $entity, $options = [])
* @method \App\Model\Entity\StateCreated patchEntity(\Cake\Datasource\EntityInterface $entity, array $data, array $options = [])
* @method \App\Model\Entity\StateCreated[] patchEntities($entities, array $data, array $options = [])
* @method \App\Model\Entity\StateCreated findOrCreate($search, callable $callback = null, $options = [])
*
* @mixin \Cake\ORM\Behavior\TimestampBehavior
*/
class StateCreatedTable extends Table
{
/**
* Initialize method
*
* @param array $config The configuration for the Table.
* @return void
*/
public function initialize(array $config)
{
parent::initialize($config);
$this->setTable('state_created');
$this->setDisplayField('id');
$this->setPrimaryKey('id');
$this->addBehavior('Timestamp');
$this->belongsTo('Transactions', [
'foreignKey' => 'transaction_id',
'joinType' => 'INNER'
]);
$this->belongsTo('StateUsers', [
'foreignKey' => 'state_user_id',
'joinType' => 'INNER'
]);
}
/**
* Default validation rules.
*
* @param \Cake\Validation\Validator $validator Validator instance.
* @return \Cake\Validation\Validator
*/
public function validationDefault(Validator $validator)
{
$validator
->integer('id')
->allowEmptyString('id', null, 'create');
$validator
->requirePresence('month', 'create')
->notEmptyString('month');
$validator
->requirePresence('year', 'create')
->notEmptyString('year');
$validator
->integer('short_ident_hash')
->requirePresence('short_ident_hash', 'create')
->notEmptyString('short_ident_hash');
return $validator;
}
/**
* Returns a rules checker object that will be used for validating
* application integrity.
*
* @param \Cake\ORM\RulesChecker $rules The rules object to be modified.
* @return \Cake\ORM\RulesChecker
*/
public function buildRules(RulesChecker $rules)
{
$rules->add($rules->existsIn(['transaction_id'], 'Transactions'));
$rules->add($rules->existsIn(['state_user_id'], 'StateUsers'));
return $rules;
}
}

View File

@ -0,0 +1,83 @@
<?php
namespace App\Model\Table;
use Cake\ORM\Query;
use Cake\ORM\RulesChecker;
use Cake\ORM\Table;
use Cake\Validation\Validator;
/**
* StateGroupAddresses Model
*
* @property \App\Model\Table\StateGroupsTable&\Cake\ORM\Association\BelongsTo $StateGroups
* @property \App\Model\Table\AddressTypesTable&\Cake\ORM\Association\BelongsTo $AddressTypes
*
* @method \App\Model\Entity\StateGroupAddress get($primaryKey, $options = [])
* @method \App\Model\Entity\StateGroupAddress newEntity($data = null, array $options = [])
* @method \App\Model\Entity\StateGroupAddress[] newEntities(array $data, array $options = [])
* @method \App\Model\Entity\StateGroupAddress|false save(\Cake\Datasource\EntityInterface $entity, $options = [])
* @method \App\Model\Entity\StateGroupAddress saveOrFail(\Cake\Datasource\EntityInterface $entity, $options = [])
* @method \App\Model\Entity\StateGroupAddress patchEntity(\Cake\Datasource\EntityInterface $entity, array $data, array $options = [])
* @method \App\Model\Entity\StateGroupAddress[] patchEntities($entities, array $data, array $options = [])
* @method \App\Model\Entity\StateGroupAddress findOrCreate($search, callable $callback = null, $options = [])
*/
class StateGroupAddressesTable extends Table
{
/**
* Initialize method
*
* @param array $config The configuration for the Table.
* @return void
*/
public function initialize(array $config)
{
parent::initialize($config);
$this->setTable('state_group_addresses');
$this->setDisplayField('id');
$this->setPrimaryKey('id');
$this->belongsTo('StateGroups', [
'foreignKey' => 'state_group_id',
'joinType' => 'INNER'
]);
$this->belongsTo('AddressTypes', [
'foreignKey' => 'address_type_id',
'joinType' => 'INNER'
]);
}
/**
* Default validation rules.
*
* @param \Cake\Validation\Validator $validator Validator instance.
* @return \Cake\Validation\Validator
*/
public function validationDefault(Validator $validator)
{
$validator
->integer('id')
->allowEmptyString('id', null, 'create');
$validator
->requirePresence('public_key', 'create')
->notEmptyString('public_key');
return $validator;
}
/**
* Returns a rules checker object that will be used for validating
* application integrity.
*
* @param \Cake\ORM\RulesChecker $rules The rules object to be modified.
* @return \Cake\ORM\RulesChecker
*/
public function buildRules(RulesChecker $rules)
{
$rules->add($rules->existsIn(['state_group_id'], 'StateGroups'));
$rules->add($rules->existsIn(['address_type_id'], 'AddressTypes'));
return $rules;
}
}

View File

@ -0,0 +1,85 @@
<?php
namespace App\Model\Table;
use Cake\ORM\Query;
use Cake\ORM\RulesChecker;
use Cake\ORM\Table;
use Cake\Validation\Validator;
/**
* StateGroupRelationships Model
*
* @property \App\Model\Table\StateGroup1sTable&\Cake\ORM\Association\BelongsTo $StateGroup1s
* @property \App\Model\Table\StateGroup2sTable&\Cake\ORM\Association\BelongsTo $StateGroup2s
* @property \App\Model\Table\StateRelationshipsTable&\Cake\ORM\Association\BelongsTo $StateRelationships
*
* @method \App\Model\Entity\StateGroupRelationship get($primaryKey, $options = [])
* @method \App\Model\Entity\StateGroupRelationship newEntity($data = null, array $options = [])
* @method \App\Model\Entity\StateGroupRelationship[] newEntities(array $data, array $options = [])
* @method \App\Model\Entity\StateGroupRelationship|false save(\Cake\Datasource\EntityInterface $entity, $options = [])
* @method \App\Model\Entity\StateGroupRelationship saveOrFail(\Cake\Datasource\EntityInterface $entity, $options = [])
* @method \App\Model\Entity\StateGroupRelationship patchEntity(\Cake\Datasource\EntityInterface $entity, array $data, array $options = [])
* @method \App\Model\Entity\StateGroupRelationship[] patchEntities($entities, array $data, array $options = [])
* @method \App\Model\Entity\StateGroupRelationship findOrCreate($search, callable $callback = null, $options = [])
*/
class StateGroupRelationshipsTable extends Table
{
/**
* Initialize method
*
* @param array $config The configuration for the Table.
* @return void
*/
public function initialize(array $config)
{
parent::initialize($config);
$this->setTable('state_group_relationships');
$this->setDisplayField('id');
$this->setPrimaryKey('id');
$this->belongsTo('StateGroup1s', [
'foreignKey' => 'state_group1_id',
'joinType' => 'INNER'
]);
$this->belongsTo('StateGroup2s', [
'foreignKey' => 'state_group2_id',
'joinType' => 'INNER'
]);
$this->belongsTo('StateRelationships', [
'foreignKey' => 'state_relationship_id',
'joinType' => 'INNER'
]);
}
/**
* Default validation rules.
*
* @param \Cake\Validation\Validator $validator Validator instance.
* @return \Cake\Validation\Validator
*/
public function validationDefault(Validator $validator)
{
$validator
->integer('id')
->allowEmptyString('id', null, 'create');
return $validator;
}
/**
* Returns a rules checker object that will be used for validating
* application integrity.
*
* @param \Cake\ORM\RulesChecker $rules The rules object to be modified.
* @return \Cake\ORM\RulesChecker
*/
public function buildRules(RulesChecker $rules)
{
$rules->add($rules->existsIn(['state_group1_id'], 'StateGroup1s'));
$rules->add($rules->existsIn(['state_group2_id'], 'StateGroup2s'));
$rules->add($rules->existsIn(['state_relationship_id'], 'StateRelationships'));
return $rules;
}
}

View File

@ -0,0 +1,102 @@
<?php
namespace App\Model\Table;
use Cake\ORM\Query;
use Cake\ORM\RulesChecker;
use Cake\ORM\Table;
use Cake\Validation\Validator;
/**
* StateGroups Model
*
* @property \App\Model\Table\IndicesTable&\Cake\ORM\Association\BelongsTo $Indices
* @property \App\Model\Table\StateGroupAddressesTable&\Cake\ORM\Association\HasMany $StateGroupAddresses
* @property \App\Model\Table\StateUsersTable&\Cake\ORM\Association\HasMany $StateUsers
* @property \App\Model\Table\TransactionGroupCreatesTable&\Cake\ORM\Association\HasMany $TransactionGroupCreates
* @property \App\Model\Table\TransactionsTable&\Cake\ORM\Association\HasMany $Transactions
*
* @method \App\Model\Entity\StateGroup get($primaryKey, $options = [])
* @method \App\Model\Entity\StateGroup newEntity($data = null, array $options = [])
* @method \App\Model\Entity\StateGroup[] newEntities(array $data, array $options = [])
* @method \App\Model\Entity\StateGroup|false save(\Cake\Datasource\EntityInterface $entity, $options = [])
* @method \App\Model\Entity\StateGroup saveOrFail(\Cake\Datasource\EntityInterface $entity, $options = [])
* @method \App\Model\Entity\StateGroup patchEntity(\Cake\Datasource\EntityInterface $entity, array $data, array $options = [])
* @method \App\Model\Entity\StateGroup[] patchEntities($entities, array $data, array $options = [])
* @method \App\Model\Entity\StateGroup findOrCreate($search, callable $callback = null, $options = [])
*/
class StateGroupsTable extends Table
{
/**
* Initialize method
*
* @param array $config The configuration for the Table.
* @return void
*/
public function initialize(array $config)
{
parent::initialize($config);
$this->setTable('state_groups');
$this->setDisplayField('name');
$this->setPrimaryKey('id');
$this->belongsTo('Indices', [
'foreignKey' => 'index_id',
'joinType' => 'INNER'
]);
$this->hasMany('StateGroupAddresses', [
'foreignKey' => 'state_group_id'
]);
$this->hasMany('StateUsers', [
'foreignKey' => 'state_group_id'
]);
$this->hasMany('TransactionGroupCreates', [
'foreignKey' => 'state_group_id'
]);
$this->hasMany('Transactions', [
'foreignKey' => 'state_group_id'
]);
}
/**
* Default validation rules.
*
* @param \Cake\Validation\Validator $validator Validator instance.
* @return \Cake\Validation\Validator
*/
public function validationDefault(Validator $validator)
{
$validator
->integer('id')
->allowEmptyString('id', null, 'create');
$validator
->scalar('name')
->maxLength('name', 50)
->requirePresence('name', 'create')
->notEmptyString('name');
$validator
->requirePresence('root_public_key', 'create')
->notEmptyString('root_public_key');
$validator
->notEmptyString('user_count');
return $validator;
}
/**
* Returns a rules checker object that will be used for validating
* application integrity.
*
* @param \Cake\ORM\RulesChecker $rules The rules object to be modified.
* @return \Cake\ORM\RulesChecker
*/
public function buildRules(RulesChecker $rules)
{
$rules->add($rules->existsIn(['index_id'], 'Indices'));
return $rules;
}
}

View File

@ -0,0 +1,63 @@
<?php
namespace App\Model\Table;
use Cake\ORM\Query;
use Cake\ORM\RulesChecker;
use Cake\ORM\Table;
use Cake\Validation\Validator;
/**
* StateRelationshipTypes Model
*
* @method \App\Model\Entity\StateRelationshipType get($primaryKey, $options = [])
* @method \App\Model\Entity\StateRelationshipType newEntity($data = null, array $options = [])
* @method \App\Model\Entity\StateRelationshipType[] newEntities(array $data, array $options = [])
* @method \App\Model\Entity\StateRelationshipType|false save(\Cake\Datasource\EntityInterface $entity, $options = [])
* @method \App\Model\Entity\StateRelationshipType saveOrFail(\Cake\Datasource\EntityInterface $entity, $options = [])
* @method \App\Model\Entity\StateRelationshipType patchEntity(\Cake\Datasource\EntityInterface $entity, array $data, array $options = [])
* @method \App\Model\Entity\StateRelationshipType[] patchEntities($entities, array $data, array $options = [])
* @method \App\Model\Entity\StateRelationshipType findOrCreate($search, callable $callback = null, $options = [])
*/
class StateRelationshipTypesTable extends Table
{
/**
* Initialize method
*
* @param array $config The configuration for the Table.
* @return void
*/
public function initialize(array $config)
{
parent::initialize($config);
$this->setTable('state_relationship_types');
$this->setDisplayField('name');
$this->setPrimaryKey('id');
}
/**
* Default validation rules.
*
* @param \Cake\Validation\Validator $validator Validator instance.
* @return \Cake\Validation\Validator
*/
public function validationDefault(Validator $validator)
{
$validator
->integer('id')
->allowEmptyString('id', null, 'create');
$validator
->scalar('name')
->maxLength('name', 25)
->requirePresence('name', 'create')
->notEmptyString('name');
$validator
->scalar('text')
->maxLength('text', 255)
->allowEmptyString('text');
return $validator;
}
}

View File

@ -0,0 +1,99 @@
<?php
namespace App\Model\Table;
use Cake\ORM\Query;
use Cake\ORM\RulesChecker;
use Cake\ORM\Table;
use Cake\Validation\Validator;
/**
* StateUsers Model
*
* @property \App\Model\Table\IndicesTable&\Cake\ORM\Association\BelongsTo $Indices
* @property \App\Model\Table\StateGroupsTable&\Cake\ORM\Association\BelongsTo $StateGroups
* @property \App\Model\Table\StateBalancesTable&\Cake\ORM\Association\HasMany $StateBalances
* @property \App\Model\Table\StateCreatedTable&\Cake\ORM\Association\HasMany $StateCreated
* @property \App\Model\Table\TransactionCreationsTable&\Cake\ORM\Association\HasMany $TransactionCreations
* @property \App\Model\Table\TransactionSendCoinsTable&\Cake\ORM\Association\HasMany $TransactionSendCoins
*
* @method \App\Model\Entity\StateUser get($primaryKey, $options = [])
* @method \App\Model\Entity\StateUser newEntity($data = null, array $options = [])
* @method \App\Model\Entity\StateUser[] newEntities(array $data, array $options = [])
* @method \App\Model\Entity\StateUser|false save(\Cake\Datasource\EntityInterface $entity, $options = [])
* @method \App\Model\Entity\StateUser saveOrFail(\Cake\Datasource\EntityInterface $entity, $options = [])
* @method \App\Model\Entity\StateUser patchEntity(\Cake\Datasource\EntityInterface $entity, array $data, array $options = [])
* @method \App\Model\Entity\StateUser[] patchEntities($entities, array $data, array $options = [])
* @method \App\Model\Entity\StateUser findOrCreate($search, callable $callback = null, $options = [])
*/
class StateUsersTable extends Table
{
/**
* Initialize method
*
* @param array $config The configuration for the Table.
* @return void
*/
public function initialize(array $config)
{
parent::initialize($config);
$this->setTable('state_users');
$this->setDisplayField('id');
$this->setPrimaryKey('id');
$this->belongsTo('Indices', [
'foreignKey' => 'index_id',
'joinType' => 'INNER'
]);
$this->belongsTo('StateGroups', [
'foreignKey' => 'state_group_id',
'joinType' => 'INNER'
]);
$this->hasMany('StateBalances', [
'foreignKey' => 'state_user_id'
]);
$this->hasMany('StateCreated', [
'foreignKey' => 'state_user_id'
]);
$this->hasMany('TransactionCreations', [
'foreignKey' => 'state_user_id'
]);
$this->hasMany('TransactionSendCoins', [
'foreignKey' => 'state_user_id'
]);
}
/**
* Default validation rules.
*
* @param \Cake\Validation\Validator $validator Validator instance.
* @return \Cake\Validation\Validator
*/
public function validationDefault(Validator $validator)
{
$validator
->integer('id')
->allowEmptyString('id', null, 'create');
$validator
->requirePresence('public_key', 'create')
->notEmptyString('public_key');
return $validator;
}
/**
* Returns a rules checker object that will be used for validating
* application integrity.
*
* @param \Cake\ORM\RulesChecker $rules The rules object to be modified.
* @return \Cake\ORM\RulesChecker
*/
public function buildRules(RulesChecker $rules)
{
$rules->add($rules->existsIn(['index_id'], 'Indices'));
$rules->add($rules->existsIn(['state_group_id'], 'StateGroups'));
return $rules;
}
}

View File

@ -0,0 +1,87 @@
<?php
namespace App\Model\Table;
use Cake\ORM\Query;
use Cake\ORM\RulesChecker;
use Cake\ORM\Table;
use Cake\Validation\Validator;
/**
* TransactionCreations Model
*
* @property \App\Model\Table\TransactionsTable&\Cake\ORM\Association\BelongsTo $Transactions
* @property \App\Model\Table\StateUsersTable&\Cake\ORM\Association\BelongsTo $StateUsers
*
* @method \App\Model\Entity\TransactionCreation get($primaryKey, $options = [])
* @method \App\Model\Entity\TransactionCreation newEntity($data = null, array $options = [])
* @method \App\Model\Entity\TransactionCreation[] newEntities(array $data, array $options = [])
* @method \App\Model\Entity\TransactionCreation|false save(\Cake\Datasource\EntityInterface $entity, $options = [])
* @method \App\Model\Entity\TransactionCreation saveOrFail(\Cake\Datasource\EntityInterface $entity, $options = [])
* @method \App\Model\Entity\TransactionCreation patchEntity(\Cake\Datasource\EntityInterface $entity, array $data, array $options = [])
* @method \App\Model\Entity\TransactionCreation[] patchEntities($entities, array $data, array $options = [])
* @method \App\Model\Entity\TransactionCreation findOrCreate($search, callable $callback = null, $options = [])
*/
class TransactionCreationsTable extends Table
{
/**
* Initialize method
*
* @param array $config The configuration for the Table.
* @return void
*/
public function initialize(array $config)
{
parent::initialize($config);
$this->setTable('transaction_creations');
$this->setDisplayField('id');
$this->setPrimaryKey('id');
$this->belongsTo('Transactions', [
'foreignKey' => 'transaction_id',
'joinType' => 'INNER'
]);
$this->belongsTo('StateUsers', [
'foreignKey' => 'state_user_id',
'joinType' => 'INNER'
]);
}
/**
* Default validation rules.
*
* @param \Cake\Validation\Validator $validator Validator instance.
* @return \Cake\Validation\Validator
*/
public function validationDefault(Validator $validator)
{
$validator
->integer('id')
->allowEmptyString('id', null, 'create');
$validator
->requirePresence('amount', 'create')
->notEmptyString('amount');
$validator
->requirePresence('ident_hash', 'create')
->notEmptyString('ident_hash');
return $validator;
}
/**
* Returns a rules checker object that will be used for validating
* application integrity.
*
* @param \Cake\ORM\RulesChecker $rules The rules object to be modified.
* @return \Cake\ORM\RulesChecker
*/
public function buildRules(RulesChecker $rules)
{
$rules->add($rules->existsIn(['transaction_id'], 'Transactions'));
$rules->add($rules->existsIn(['state_user_id'], 'StateUsers'));
return $rules;
}
}

View File

@ -0,0 +1,83 @@
<?php
namespace App\Model\Table;
use Cake\ORM\Query;
use Cake\ORM\RulesChecker;
use Cake\ORM\Table;
use Cake\Validation\Validator;
/**
* TransactionGroupAddaddress Model
*
* @property \App\Model\Table\TransactionsTable&\Cake\ORM\Association\BelongsTo $Transactions
* @property \App\Model\Table\AddressTypesTable&\Cake\ORM\Association\BelongsTo $AddressTypes
*
* @method \App\Model\Entity\TransactionGroupAddaddres get($primaryKey, $options = [])
* @method \App\Model\Entity\TransactionGroupAddaddres newEntity($data = null, array $options = [])
* @method \App\Model\Entity\TransactionGroupAddaddres[] newEntities(array $data, array $options = [])
* @method \App\Model\Entity\TransactionGroupAddaddres|false save(\Cake\Datasource\EntityInterface $entity, $options = [])
* @method \App\Model\Entity\TransactionGroupAddaddres saveOrFail(\Cake\Datasource\EntityInterface $entity, $options = [])
* @method \App\Model\Entity\TransactionGroupAddaddres patchEntity(\Cake\Datasource\EntityInterface $entity, array $data, array $options = [])
* @method \App\Model\Entity\TransactionGroupAddaddres[] patchEntities($entities, array $data, array $options = [])
* @method \App\Model\Entity\TransactionGroupAddaddres findOrCreate($search, callable $callback = null, $options = [])
*/
class TransactionGroupAddaddressTable extends Table
{
/**
* Initialize method
*
* @param array $config The configuration for the Table.
* @return void
*/
public function initialize(array $config)
{
parent::initialize($config);
$this->setTable('transaction_group_addaddress');
$this->setDisplayField('id');
$this->setPrimaryKey('id');
$this->belongsTo('Transactions', [
'foreignKey' => 'transaction_id',
'joinType' => 'INNER'
]);
$this->belongsTo('AddressTypes', [
'foreignKey' => 'address_type_id',
'joinType' => 'INNER'
]);
}
/**
* Default validation rules.
*
* @param \Cake\Validation\Validator $validator Validator instance.
* @return \Cake\Validation\Validator
*/
public function validationDefault(Validator $validator)
{
$validator
->integer('id')
->allowEmptyString('id', null, 'create');
$validator
->requirePresence('public_key', 'create')
->notEmptyString('public_key');
return $validator;
}
/**
* Returns a rules checker object that will be used for validating
* application integrity.
*
* @param \Cake\ORM\RulesChecker $rules The rules object to be modified.
* @return \Cake\ORM\RulesChecker
*/
public function buildRules(RulesChecker $rules)
{
$rules->add($rules->existsIn(['transaction_id'], 'Transactions'));
$rules->add($rules->existsIn(['address_type_id'], 'AddressTypes'));
return $rules;
}
}

View File

@ -0,0 +1,83 @@
<?php
namespace App\Model\Table;
use Cake\ORM\Query;
use Cake\ORM\RulesChecker;
use Cake\ORM\Table;
use Cake\Validation\Validator;
/**
* TransactionGroupAllowtrades Model
*
* @property \App\Model\Table\TransactionsTable&\Cake\ORM\Association\BelongsTo $Transactions
* @property \App\Model\Table\GroupsTable&\Cake\ORM\Association\BelongsTo $Groups
*
* @method \App\Model\Entity\TransactionGroupAllowtrade get($primaryKey, $options = [])
* @method \App\Model\Entity\TransactionGroupAllowtrade newEntity($data = null, array $options = [])
* @method \App\Model\Entity\TransactionGroupAllowtrade[] newEntities(array $data, array $options = [])
* @method \App\Model\Entity\TransactionGroupAllowtrade|false save(\Cake\Datasource\EntityInterface $entity, $options = [])
* @method \App\Model\Entity\TransactionGroupAllowtrade saveOrFail(\Cake\Datasource\EntityInterface $entity, $options = [])
* @method \App\Model\Entity\TransactionGroupAllowtrade patchEntity(\Cake\Datasource\EntityInterface $entity, array $data, array $options = [])
* @method \App\Model\Entity\TransactionGroupAllowtrade[] patchEntities($entities, array $data, array $options = [])
* @method \App\Model\Entity\TransactionGroupAllowtrade findOrCreate($search, callable $callback = null, $options = [])
*/
class TransactionGroupAllowtradesTable extends Table
{
/**
* Initialize method
*
* @param array $config The configuration for the Table.
* @return void
*/
public function initialize(array $config)
{
parent::initialize($config);
$this->setTable('transaction_group_allowtrades');
$this->setDisplayField('id');
$this->setPrimaryKey('id');
$this->belongsTo('Transactions', [
'foreignKey' => 'transaction_id',
'joinType' => 'INNER'
]);
$this->belongsTo('Groups', [
'foreignKey' => 'group_id',
'joinType' => 'INNER'
]);
}
/**
* Default validation rules.
*
* @param \Cake\Validation\Validator $validator Validator instance.
* @return \Cake\Validation\Validator
*/
public function validationDefault(Validator $validator)
{
$validator
->integer('id')
->allowEmptyString('id', null, 'create');
$validator
->boolean('allow')
->notEmptyString('allow');
return $validator;
}
/**
* Returns a rules checker object that will be used for validating
* application integrity.
*
* @param \Cake\ORM\RulesChecker $rules The rules object to be modified.
* @return \Cake\ORM\RulesChecker
*/
public function buildRules(RulesChecker $rules)
{
$rules->add($rules->existsIn(['transaction_id'], 'Transactions'));
$rules->add($rules->existsIn(['group_id'], 'Groups'));
return $rules;
}
}

View File

@ -0,0 +1,89 @@
<?php
namespace App\Model\Table;
use Cake\ORM\Query;
use Cake\ORM\RulesChecker;
use Cake\ORM\Table;
use Cake\Validation\Validator;
/**
* TransactionGroupCreates Model
*
* @property \App\Model\Table\TransactionsTable&\Cake\ORM\Association\BelongsTo $Transactions
* @property \App\Model\Table\StateGroupsTable&\Cake\ORM\Association\BelongsTo $StateGroups
*
* @method \App\Model\Entity\TransactionGroupCreate get($primaryKey, $options = [])
* @method \App\Model\Entity\TransactionGroupCreate newEntity($data = null, array $options = [])
* @method \App\Model\Entity\TransactionGroupCreate[] newEntities(array $data, array $options = [])
* @method \App\Model\Entity\TransactionGroupCreate|false save(\Cake\Datasource\EntityInterface $entity, $options = [])
* @method \App\Model\Entity\TransactionGroupCreate saveOrFail(\Cake\Datasource\EntityInterface $entity, $options = [])
* @method \App\Model\Entity\TransactionGroupCreate patchEntity(\Cake\Datasource\EntityInterface $entity, array $data, array $options = [])
* @method \App\Model\Entity\TransactionGroupCreate[] patchEntities($entities, array $data, array $options = [])
* @method \App\Model\Entity\TransactionGroupCreate findOrCreate($search, callable $callback = null, $options = [])
*/
class TransactionGroupCreatesTable extends Table
{
/**
* Initialize method
*
* @param array $config The configuration for the Table.
* @return void
*/
public function initialize(array $config)
{
parent::initialize($config);
$this->setTable('transaction_group_creates');
$this->setDisplayField('name');
$this->setPrimaryKey('id');
$this->belongsTo('Transactions', [
'foreignKey' => 'transaction_id',
'joinType' => 'INNER'
]);
$this->belongsTo('StateGroups', [
'foreignKey' => 'state_group_id',
'joinType' => 'INNER'
]);
}
/**
* Default validation rules.
*
* @param \Cake\Validation\Validator $validator Validator instance.
* @return \Cake\Validation\Validator
*/
public function validationDefault(Validator $validator)
{
$validator
->integer('id')
->allowEmptyString('id', null, 'create');
$validator
->requirePresence('group_public_key', 'create')
->notEmptyString('group_public_key');
$validator
->scalar('name')
->maxLength('name', 64)
->requirePresence('name', 'create')
->notEmptyString('name');
return $validator;
}
/**
* Returns a rules checker object that will be used for validating
* application integrity.
*
* @param \Cake\ORM\RulesChecker $rules The rules object to be modified.
* @return \Cake\ORM\RulesChecker
*/
public function buildRules(RulesChecker $rules)
{
$rules->add($rules->existsIn(['transaction_id'], 'Transactions'));
$rules->add($rules->existsIn(['state_group_id'], 'StateGroups'));
return $rules;
}
}

View File

@ -0,0 +1,97 @@
<?php
namespace App\Model\Table;
use Cake\ORM\Query;
use Cake\ORM\RulesChecker;
use Cake\ORM\Table;
use Cake\Validation\Validator;
/**
* TransactionSendCoins Model
*
* @property \App\Model\Table\TransactionsTable&\Cake\ORM\Association\BelongsTo $Transactions
* @property \App\Model\Table\StateUsersTable&\Cake\ORM\Association\BelongsTo $StateUsers
* @property \App\Model\Table\ReceiverUsersTable&\Cake\ORM\Association\BelongsTo $ReceiverUsers
*
* @method \App\Model\Entity\TransactionSendCoin get($primaryKey, $options = [])
* @method \App\Model\Entity\TransactionSendCoin newEntity($data = null, array $options = [])
* @method \App\Model\Entity\TransactionSendCoin[] newEntities(array $data, array $options = [])
* @method \App\Model\Entity\TransactionSendCoin|false save(\Cake\Datasource\EntityInterface $entity, $options = [])
* @method \App\Model\Entity\TransactionSendCoin saveOrFail(\Cake\Datasource\EntityInterface $entity, $options = [])
* @method \App\Model\Entity\TransactionSendCoin patchEntity(\Cake\Datasource\EntityInterface $entity, array $data, array $options = [])
* @method \App\Model\Entity\TransactionSendCoin[] patchEntities($entities, array $data, array $options = [])
* @method \App\Model\Entity\TransactionSendCoin findOrCreate($search, callable $callback = null, $options = [])
*/
class TransactionSendCoinsTable extends Table
{
/**
* Initialize method
*
* @param array $config The configuration for the Table.
* @return void
*/
public function initialize(array $config)
{
parent::initialize($config);
$this->setTable('transaction_send_coins');
$this->setDisplayField('id');
$this->setPrimaryKey('id');
$this->belongsTo('Transactions', [
'foreignKey' => 'transaction_id',
'joinType' => 'INNER'
]);
$this->belongsTo('StateUsers', [
'foreignKey' => 'state_user_id',
'joinType' => 'INNER'
]);
$this->belongsTo('ReceiverUsers', [
'foreignKey' => 'receiver_user_id',
'joinType' => 'INNER'
]);
}
/**
* Default validation rules.
*
* @param \Cake\Validation\Validator $validator Validator instance.
* @return \Cake\Validation\Validator
*/
public function validationDefault(Validator $validator)
{
$validator
->integer('id')
->allowEmptyString('id', null, 'create');
$validator
->requirePresence('receiver_public_key', 'create')
->notEmptyString('receiver_public_key');
$validator
->requirePresence('amount', 'create')
->notEmptyString('amount');
$validator
->requirePresence('sender_final_balance', 'create')
->notEmptyString('sender_final_balance');
return $validator;
}
/**
* Returns a rules checker object that will be used for validating
* application integrity.
*
* @param \Cake\ORM\RulesChecker $rules The rules object to be modified.
* @return \Cake\ORM\RulesChecker
*/
public function buildRules(RulesChecker $rules)
{
$rules->add($rules->existsIn(['transaction_id'], 'Transactions'));
$rules->add($rules->existsIn(['state_user_id'], 'StateUsers'));
$rules->add($rules->existsIn(['receiver_user_id'], 'ReceiverUsers'));
return $rules;
}
}

View File

@ -0,0 +1,81 @@
<?php
namespace App\Model\Table;
use Cake\ORM\Query;
use Cake\ORM\RulesChecker;
use Cake\ORM\Table;
use Cake\Validation\Validator;
/**
* TransactionSignatures Model
*
* @property \App\Model\Table\TransactionsTable&\Cake\ORM\Association\BelongsTo $Transactions
*
* @method \App\Model\Entity\TransactionSignature get($primaryKey, $options = [])
* @method \App\Model\Entity\TransactionSignature newEntity($data = null, array $options = [])
* @method \App\Model\Entity\TransactionSignature[] newEntities(array $data, array $options = [])
* @method \App\Model\Entity\TransactionSignature|false save(\Cake\Datasource\EntityInterface $entity, $options = [])
* @method \App\Model\Entity\TransactionSignature saveOrFail(\Cake\Datasource\EntityInterface $entity, $options = [])
* @method \App\Model\Entity\TransactionSignature patchEntity(\Cake\Datasource\EntityInterface $entity, array $data, array $options = [])
* @method \App\Model\Entity\TransactionSignature[] patchEntities($entities, array $data, array $options = [])
* @method \App\Model\Entity\TransactionSignature findOrCreate($search, callable $callback = null, $options = [])
*/
class TransactionSignaturesTable extends Table
{
/**
* Initialize method
*
* @param array $config The configuration for the Table.
* @return void
*/
public function initialize(array $config)
{
parent::initialize($config);
$this->setTable('transaction_signatures');
$this->setDisplayField('id');
$this->setPrimaryKey('id');
$this->belongsTo('Transactions', [
'foreignKey' => 'transaction_id',
'joinType' => 'INNER'
]);
}
/**
* Default validation rules.
*
* @param \Cake\Validation\Validator $validator Validator instance.
* @return \Cake\Validation\Validator
*/
public function validationDefault(Validator $validator)
{
$validator
->integer('id')
->allowEmptyString('id', null, 'create');
$validator
->requirePresence('signature', 'create')
->notEmptyString('signature');
$validator
->requirePresence('pubkey', 'create')
->notEmptyString('pubkey');
return $validator;
}
/**
* Returns a rules checker object that will be used for validating
* application integrity.
*
* @param \Cake\ORM\RulesChecker $rules The rules object to be modified.
* @return \Cake\ORM\RulesChecker
*/
public function buildRules(RulesChecker $rules)
{
$rules->add($rules->existsIn(['transaction_id'], 'Transactions'));
return $rules;
}
}

View File

@ -0,0 +1,69 @@
<?php
namespace App\Model\Table;
use Cake\ORM\Query;
use Cake\ORM\RulesChecker;
use Cake\ORM\Table;
use Cake\Validation\Validator;
/**
* TransactionTypes Model
*
* @property \App\Model\Table\TransactionsTable&\Cake\ORM\Association\HasMany $Transactions
*
* @method \App\Model\Entity\TransactionType get($primaryKey, $options = [])
* @method \App\Model\Entity\TransactionType newEntity($data = null, array $options = [])
* @method \App\Model\Entity\TransactionType[] newEntities(array $data, array $options = [])
* @method \App\Model\Entity\TransactionType|false save(\Cake\Datasource\EntityInterface $entity, $options = [])
* @method \App\Model\Entity\TransactionType saveOrFail(\Cake\Datasource\EntityInterface $entity, $options = [])
* @method \App\Model\Entity\TransactionType patchEntity(\Cake\Datasource\EntityInterface $entity, array $data, array $options = [])
* @method \App\Model\Entity\TransactionType[] patchEntities($entities, array $data, array $options = [])
* @method \App\Model\Entity\TransactionType findOrCreate($search, callable $callback = null, $options = [])
*/
class TransactionTypesTable extends Table
{
/**
* Initialize method
*
* @param array $config The configuration for the Table.
* @return void
*/
public function initialize(array $config)
{
parent::initialize($config);
$this->setTable('transaction_types');
$this->setDisplayField('name');
$this->setPrimaryKey('id');
$this->hasMany('Transactions', [
'foreignKey' => 'transaction_type_id'
]);
}
/**
* Default validation rules.
*
* @param \Cake\Validation\Validator $validator Validator instance.
* @return \Cake\Validation\Validator
*/
public function validationDefault(Validator $validator)
{
$validator
->integer('id')
->allowEmptyString('id', null, 'create');
$validator
->scalar('name')
->maxLength('name', 24)
->requirePresence('name', 'create')
->notEmptyString('name');
$validator
->scalar('text')
->maxLength('text', 255)
->allowEmptyString('text');
return $validator;
}
}

View File

@ -0,0 +1,114 @@
<?php
namespace App\Model\Table;
use Cake\ORM\Query;
use Cake\ORM\RulesChecker;
use Cake\ORM\Table;
use Cake\Validation\Validator;
/**
* Transactions Model
*
* @property \App\Model\Table\StateGroupsTable&\Cake\ORM\Association\BelongsTo $StateGroups
* @property \App\Model\Table\TransactionTypesTable&\Cake\ORM\Association\BelongsTo $TransactionTypes
* @property \App\Model\Table\StateCreatedTable&\Cake\ORM\Association\HasMany $StateCreated
* @property \App\Model\Table\TransactionCreationsTable&\Cake\ORM\Association\HasMany $TransactionCreations
* @property \App\Model\Table\TransactionGroupAddaddressTable&\Cake\ORM\Association\HasMany $TransactionGroupAddaddress
* @property \App\Model\Table\TransactionGroupAllowtradesTable&\Cake\ORM\Association\HasMany $TransactionGroupAllowtrades
* @property \App\Model\Table\TransactionGroupCreatesTable&\Cake\ORM\Association\HasMany $TransactionGroupCreates
* @property \App\Model\Table\TransactionSendCoinsTable&\Cake\ORM\Association\HasMany $TransactionSendCoins
* @property \App\Model\Table\TransactionSignaturesTable&\Cake\ORM\Association\HasMany $TransactionSignatures
*
* @method \App\Model\Entity\Transaction get($primaryKey, $options = [])
* @method \App\Model\Entity\Transaction newEntity($data = null, array $options = [])
* @method \App\Model\Entity\Transaction[] newEntities(array $data, array $options = [])
* @method \App\Model\Entity\Transaction|false save(\Cake\Datasource\EntityInterface $entity, $options = [])
* @method \App\Model\Entity\Transaction saveOrFail(\Cake\Datasource\EntityInterface $entity, $options = [])
* @method \App\Model\Entity\Transaction patchEntity(\Cake\Datasource\EntityInterface $entity, array $data, array $options = [])
* @method \App\Model\Entity\Transaction[] patchEntities($entities, array $data, array $options = [])
* @method \App\Model\Entity\Transaction findOrCreate($search, callable $callback = null, $options = [])
*/
class TransactionsTable extends Table
{
/**
* Initialize method
*
* @param array $config The configuration for the Table.
* @return void
*/
public function initialize(array $config)
{
parent::initialize($config);
$this->setTable('transactions');
$this->setDisplayField('id');
$this->setPrimaryKey('id');
$this->belongsTo('StateGroups', [
'foreignKey' => 'state_group_id',
'joinType' => 'INNER'
]);
$this->belongsTo('TransactionTypes', [
'foreignKey' => 'transaction_type_id',
'joinType' => 'INNER'
]);
$this->hasMany('StateCreated', [
'foreignKey' => 'transaction_id'
]);
$this->hasMany('TransactionCreations', [
'foreignKey' => 'transaction_id'
]);
$this->hasMany('TransactionGroupAddaddress', [
'foreignKey' => 'transaction_id'
]);
$this->hasMany('TransactionGroupAllowtrades', [
'foreignKey' => 'transaction_id'
]);
$this->hasMany('TransactionGroupCreates', [
'foreignKey' => 'transaction_id'
]);
$this->hasMany('TransactionSendCoins', [
'foreignKey' => 'transaction_id'
]);
$this->hasMany('TransactionSignatures', [
'foreignKey' => 'transaction_id'
]);
}
/**
* Default validation rules.
*
* @param \Cake\Validation\Validator $validator Validator instance.
* @return \Cake\Validation\Validator
*/
public function validationDefault(Validator $validator)
{
$validator
->allowEmptyString('id', null, 'create');
$validator
->requirePresence('tx_hash', 'create')
->notEmptyString('tx_hash');
$validator
->dateTime('received')
->notEmptyDateTime('received');
return $validator;
}
/**
* Returns a rules checker object that will be used for validating
* application integrity.
*
* @param \Cake\ORM\RulesChecker $rules The rules object to be modified.
* @return \Cake\ORM\RulesChecker
*/
public function buildRules(RulesChecker $rules)
{
$rules->add($rules->existsIn(['state_group_id'], 'StateGroups'));
$rules->add($rules->existsIn(['transaction_type_id'], 'TransactionTypes'));
return $rules;
}
}

View File

@ -0,0 +1,81 @@
<?php
/**
* CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
* Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
*
* Licensed under The MIT License
* For full copyright and license information, please see the LICENSE.txt
* Redistributions of files must retain the above copyright notice.
*
* @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
* @link https://cakephp.org CakePHP(tm) Project
* @since 3.0.0
* @license https://opensource.org/licenses/mit-license.php MIT License
*/
namespace App\Shell;
use Cake\Console\ConsoleOptionParser;
use Cake\Console\Shell;
use Cake\Log\Log;
use Psy\Shell as PsyShell;
/**
* Simple console wrapper around Psy\Shell.
*/
class ConsoleShell extends Shell
{
/**
* Start the shell and interactive console.
*
* @return int|null
*/
public function main()
{
if (!class_exists('Psy\Shell')) {
$this->err('<error>Unable to load Psy\Shell.</error>');
$this->err('');
$this->err('Make sure you have installed psysh as a dependency,');
$this->err('and that Psy\Shell is registered in your autoloader.');
$this->err('');
$this->err('If you are using composer run');
$this->err('');
$this->err('<info>$ php composer.phar require --dev psy/psysh</info>');
$this->err('');
return self::CODE_ERROR;
}
$this->out("You can exit with <info>`CTRL-C`</info> or <info>`exit`</info>");
$this->out('');
Log::drop('debug');
Log::drop('error');
$this->_io->setLoggers(false);
restore_error_handler();
restore_exception_handler();
$psy = new PsyShell();
$psy->run();
}
/**
* Display help for this console.
*
* @return \Cake\Console\ConsoleOptionParser
*/
public function getOptionParser()
{
$parser = new ConsoleOptionParser('console');
$parser->setDescription(
'This shell provides a REPL that you can use to interact with ' .
'your application in a command line designed to run PHP code. ' .
'You can use it to run adhoc queries with your models, or ' .
'explore the features of CakePHP and your application.' .
"\n\n" .
'You will need to have psysh installed for this Shell to work.'
);
return $parser;
}
}

View File

@ -0,0 +1,28 @@
<?php
/**
* @var \App\View\AppView $this
* @var \App\Model\Entity\AddressType $addressType
*/
?>
<nav class="large-3 medium-4 columns" id="actions-sidebar">
<ul class="side-nav">
<li class="heading"><?= __('Actions') ?></li>
<li><?= $this->Html->link(__('List Address Types'), ['action' => 'index']) ?></li>
<li><?= $this->Html->link(__('List State Group Addresses'), ['controller' => 'StateGroupAddresses', 'action' => 'index']) ?></li>
<li><?= $this->Html->link(__('New State Group Address'), ['controller' => 'StateGroupAddresses', 'action' => 'add']) ?></li>
<li><?= $this->Html->link(__('List Transaction Group Addaddress'), ['controller' => 'TransactionGroupAddaddress', 'action' => 'index']) ?></li>
<li><?= $this->Html->link(__('New Transaction Group Addaddres'), ['controller' => 'TransactionGroupAddaddress', 'action' => 'add']) ?></li>
</ul>
</nav>
<div class="addressTypes form large-9 medium-8 columns content">
<?= $this->Form->create($addressType) ?>
<fieldset>
<legend><?= __('Add Address Type') ?></legend>
<?php
echo $this->Form->control('name');
echo $this->Form->control('text');
?>
</fieldset>
<?= $this->Form->button(__('Submit')) ?>
<?= $this->Form->end() ?>
</div>

View File

@ -0,0 +1,34 @@
<?php
/**
* @var \App\View\AppView $this
* @var \App\Model\Entity\AddressType $addressType
*/
?>
<nav class="large-3 medium-4 columns" id="actions-sidebar">
<ul class="side-nav">
<li class="heading"><?= __('Actions') ?></li>
<li><?= $this->Form->postLink(
__('Delete'),
['action' => 'delete', $addressType->id],
['confirm' => __('Are you sure you want to delete # {0}?', $addressType->id)]
)
?></li>
<li><?= $this->Html->link(__('List Address Types'), ['action' => 'index']) ?></li>
<li><?= $this->Html->link(__('List State Group Addresses'), ['controller' => 'StateGroupAddresses', 'action' => 'index']) ?></li>
<li><?= $this->Html->link(__('New State Group Address'), ['controller' => 'StateGroupAddresses', 'action' => 'add']) ?></li>
<li><?= $this->Html->link(__('List Transaction Group Addaddress'), ['controller' => 'TransactionGroupAddaddress', 'action' => 'index']) ?></li>
<li><?= $this->Html->link(__('New Transaction Group Addaddres'), ['controller' => 'TransactionGroupAddaddress', 'action' => 'add']) ?></li>
</ul>
</nav>
<div class="addressTypes form large-9 medium-8 columns content">
<?= $this->Form->create($addressType) ?>
<fieldset>
<legend><?= __('Edit Address Type') ?></legend>
<?php
echo $this->Form->control('name');
echo $this->Form->control('text');
?>
</fieldset>
<?= $this->Form->button(__('Submit')) ?>
<?= $this->Form->end() ?>
</div>

View File

@ -0,0 +1,53 @@
<?php
/**
* @var \App\View\AppView $this
* @var \App\Model\Entity\AddressType[]|\Cake\Collection\CollectionInterface $addressTypes
*/
?>
<nav class="large-3 medium-4 columns" id="actions-sidebar">
<ul class="side-nav">
<li class="heading"><?= __('Actions') ?></li>
<li><?= $this->Html->link(__('New Address Type'), ['action' => 'add']) ?></li>
<li><?= $this->Html->link(__('List State Group Addresses'), ['controller' => 'StateGroupAddresses', 'action' => 'index']) ?></li>
<li><?= $this->Html->link(__('New State Group Address'), ['controller' => 'StateGroupAddresses', 'action' => 'add']) ?></li>
<li><?= $this->Html->link(__('List Transaction Group Addaddress'), ['controller' => 'TransactionGroupAddaddress', 'action' => 'index']) ?></li>
<li><?= $this->Html->link(__('New Transaction Group Addaddres'), ['controller' => 'TransactionGroupAddaddress', 'action' => 'add']) ?></li>
</ul>
</nav>
<div class="addressTypes index large-9 medium-8 columns content">
<h3><?= __('Address Types') ?></h3>
<table cellpadding="0" cellspacing="0">
<thead>
<tr>
<th scope="col"><?= $this->Paginator->sort('id') ?></th>
<th scope="col"><?= $this->Paginator->sort('name') ?></th>
<th scope="col"><?= $this->Paginator->sort('text') ?></th>
<th scope="col" class="actions"><?= __('Actions') ?></th>
</tr>
</thead>
<tbody>
<?php foreach ($addressTypes as $addressType): ?>
<tr>
<td><?= $this->Number->format($addressType->id) ?></td>
<td><?= h($addressType->name) ?></td>
<td><?= h($addressType->text) ?></td>
<td class="actions">
<?= $this->Html->link(__('View'), ['action' => 'view', $addressType->id]) ?>
<?= $this->Html->link(__('Edit'), ['action' => 'edit', $addressType->id]) ?>
<?= $this->Form->postLink(__('Delete'), ['action' => 'delete', $addressType->id], ['confirm' => __('Are you sure you want to delete # {0}?', $addressType->id)]) ?>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<div class="paginator">
<ul class="pagination">
<?= $this->Paginator->first('<< ' . __('first')) ?>
<?= $this->Paginator->prev('< ' . __('previous')) ?>
<?= $this->Paginator->numbers() ?>
<?= $this->Paginator->next(__('next') . ' >') ?>
<?= $this->Paginator->last(__('last') . ' >>') ?>
</ul>
<p><?= $this->Paginator->counter(['format' => __('Page {{page}} of {{pages}}, showing {{current}} record(s) out of {{count}} total')]) ?></p>
</div>
</div>

View File

@ -0,0 +1,90 @@
<?php
/**
* @var \App\View\AppView $this
* @var \App\Model\Entity\AddressType $addressType
*/
?>
<nav class="large-3 medium-4 columns" id="actions-sidebar">
<ul class="side-nav">
<li class="heading"><?= __('Actions') ?></li>
<li><?= $this->Html->link(__('Edit Address Type'), ['action' => 'edit', $addressType->id]) ?> </li>
<li><?= $this->Form->postLink(__('Delete Address Type'), ['action' => 'delete', $addressType->id], ['confirm' => __('Are you sure you want to delete # {0}?', $addressType->id)]) ?> </li>
<li><?= $this->Html->link(__('List Address Types'), ['action' => 'index']) ?> </li>
<li><?= $this->Html->link(__('New Address Type'), ['action' => 'add']) ?> </li>
<li><?= $this->Html->link(__('List State Group Addresses'), ['controller' => 'StateGroupAddresses', 'action' => 'index']) ?> </li>
<li><?= $this->Html->link(__('New State Group Address'), ['controller' => 'StateGroupAddresses', 'action' => 'add']) ?> </li>
<li><?= $this->Html->link(__('List Transaction Group Addaddress'), ['controller' => 'TransactionGroupAddaddress', 'action' => 'index']) ?> </li>
<li><?= $this->Html->link(__('New Transaction Group Addaddres'), ['controller' => 'TransactionGroupAddaddress', 'action' => 'add']) ?> </li>
</ul>
</nav>
<div class="addressTypes view large-9 medium-8 columns content">
<h3><?= h($addressType->name) ?></h3>
<table class="vertical-table">
<tr>
<th scope="row"><?= __('Name') ?></th>
<td><?= h($addressType->name) ?></td>
</tr>
<tr>
<th scope="row"><?= __('Text') ?></th>
<td><?= h($addressType->text) ?></td>
</tr>
<tr>
<th scope="row"><?= __('Id') ?></th>
<td><?= $this->Number->format($addressType->id) ?></td>
</tr>
</table>
<div class="related">
<h4><?= __('Related State Group Addresses') ?></h4>
<?php if (!empty($addressType->state_group_addresses)): ?>
<table cellpadding="0" cellspacing="0">
<tr>
<th scope="col"><?= __('Id') ?></th>
<th scope="col"><?= __('State Group Id') ?></th>
<th scope="col"><?= __('Public Key') ?></th>
<th scope="col"><?= __('Address Type Id') ?></th>
<th scope="col" class="actions"><?= __('Actions') ?></th>
</tr>
<?php foreach ($addressType->state_group_addresses as $stateGroupAddresses): ?>
<tr>
<td><?= h($stateGroupAddresses->id) ?></td>
<td><?= h($stateGroupAddresses->state_group_id) ?></td>
<td><?= h($stateGroupAddresses->public_key) ?></td>
<td><?= h($stateGroupAddresses->address_type_id) ?></td>
<td class="actions">
<?= $this->Html->link(__('View'), ['controller' => 'StateGroupAddresses', 'action' => 'view', $stateGroupAddresses->id]) ?>
<?= $this->Html->link(__('Edit'), ['controller' => 'StateGroupAddresses', 'action' => 'edit', $stateGroupAddresses->id]) ?>
<?= $this->Form->postLink(__('Delete'), ['controller' => 'StateGroupAddresses', 'action' => 'delete', $stateGroupAddresses->id], ['confirm' => __('Are you sure you want to delete # {0}?', $stateGroupAddresses->id)]) ?>
</td>
</tr>
<?php endforeach; ?>
</table>
<?php endif; ?>
</div>
<div class="related">
<h4><?= __('Related Transaction Group Addaddress') ?></h4>
<?php if (!empty($addressType->transaction_group_addaddress)): ?>
<table cellpadding="0" cellspacing="0">
<tr>
<th scope="col"><?= __('Id') ?></th>
<th scope="col"><?= __('Transaction Id') ?></th>
<th scope="col"><?= __('Address Type Id') ?></th>
<th scope="col"><?= __('Public Key') ?></th>
<th scope="col" class="actions"><?= __('Actions') ?></th>
</tr>
<?php foreach ($addressType->transaction_group_addaddress as $transactionGroupAddaddress): ?>
<tr>
<td><?= h($transactionGroupAddaddress->id) ?></td>
<td><?= h($transactionGroupAddaddress->transaction_id) ?></td>
<td><?= h($transactionGroupAddaddress->address_type_id) ?></td>
<td><?= h($transactionGroupAddaddress->public_key) ?></td>
<td class="actions">
<?= $this->Html->link(__('View'), ['controller' => 'TransactionGroupAddaddress', 'action' => 'view', $transactionGroupAddaddress->id]) ?>
<?= $this->Html->link(__('Edit'), ['controller' => 'TransactionGroupAddaddress', 'action' => 'edit', $transactionGroupAddaddress->id]) ?>
<?= $this->Form->postLink(__('Delete'), ['controller' => 'TransactionGroupAddaddress', 'action' => 'delete', $transactionGroupAddaddress->id], ['confirm' => __('Are you sure you want to delete # {0}?', $transactionGroupAddaddress->id)]) ?>
</td>
</tr>
<?php endforeach; ?>
</table>
<?php endif; ?>
</div>
</div>

1
src/Template/Cell/empty Normal file
View File

@ -0,0 +1 @@

View File

@ -0,0 +1,10 @@
<?php
$class = 'message';
if (!empty($params['class'])) {
$class .= ' ' . $params['class'];
}
if (!isset($params['escape']) || $params['escape'] !== false) {
$message = h($message);
}
?>
<div class="<?= h($class) ?>" onclick="this.classList.add('hidden');"><?= $message ?></div>

View File

@ -0,0 +1,6 @@
<?php
if (!isset($params['escape']) || $params['escape'] !== false) {
$message = h($message);
}
?>
<div class="message error" onclick="this.classList.add('hidden');"><?= $message ?></div>

View File

@ -0,0 +1,6 @@
<?php
if (!isset($params['escape']) || $params['escape'] !== false) {
$message = h($message);
}
?>
<div class="message success" onclick="this.classList.add('hidden')"><?= $message ?></div>

View File

@ -0,0 +1,20 @@
<?php
/**
* CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
* Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
*
* Licensed under The MIT License
* For full copyright and license information, please see the LICENSE.txt
* Redistributions of files must retain the above copyright notice.
*
* @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
* @link https://cakephp.org CakePHP(tm) Project
* @since 0.10.0
* @license https://opensource.org/licenses/mit-license.php MIT License
*/
$content = explode("\n", $content);
foreach ($content as $line) :
echo '<p> ' . $line . "</p>\n";
endforeach;

View File

@ -0,0 +1,16 @@
<?php
/**
* CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
* Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
*
* Licensed under The MIT License
* For full copyright and license information, please see the LICENSE.txt
* Redistributions of files must retain the above copyright notice.
*
* @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
* @link https://cakephp.org CakePHP(tm) Project
* @since 0.10.0
* @license https://opensource.org/licenses/mit-license.php MIT License
*/
echo $content;

View File

@ -0,0 +1,38 @@
<?php
use Cake\Core\Configure;
use Cake\Error\Debugger;
$this->layout = 'error';
if (Configure::read('debug')) :
$this->layout = 'dev_error';
$this->assign('title', $message);
$this->assign('templateName', 'error400.ctp');
$this->start('file');
?>
<?php if (!empty($error->queryString)) : ?>
<p class="notice">
<strong>SQL Query: </strong>
<?= h($error->queryString) ?>
</p>
<?php endif; ?>
<?php if (!empty($error->params)) : ?>
<strong>SQL Query Params: </strong>
<?php Debugger::dump($error->params) ?>
<?php endif; ?>
<?= $this->element('auto_table_warning') ?>
<?php
if (extension_loaded('xdebug')) :
xdebug_print_function_stack();
endif;
$this->end();
endif;
?>
<h2><?= h($message) ?></h2>
<p class="error">
<strong><?= __d('cake', 'Error') ?>: </strong>
<?= __d('cake', 'The requested address {0} was not found on this server.', "<strong>'{$url}'</strong>") ?>
</p>

View File

@ -0,0 +1,43 @@
<?php
use Cake\Core\Configure;
use Cake\Error\Debugger;
$this->layout = 'error';
if (Configure::read('debug')) :
$this->layout = 'dev_error';
$this->assign('title', $message);
$this->assign('templateName', 'error500.ctp');
$this->start('file');
?>
<?php if (!empty($error->queryString)) : ?>
<p class="notice">
<strong>SQL Query: </strong>
<?= h($error->queryString) ?>
</p>
<?php endif; ?>
<?php if (!empty($error->params)) : ?>
<strong>SQL Query Params: </strong>
<?php Debugger::dump($error->params) ?>
<?php endif; ?>
<?php if ($error instanceof Error) : ?>
<strong>Error in: </strong>
<?= sprintf('%s, line %s', str_replace(ROOT, 'ROOT', $error->getFile()), $error->getLine()) ?>
<?php endif; ?>
<?php
echo $this->element('auto_table_warning');
if (extension_loaded('xdebug')) :
xdebug_print_function_stack();
endif;
$this->end();
endif;
?>
<h2><?= __d('cake', 'An Internal Error Has Occurred') ?></h2>
<p class="error">
<strong><?= __d('cake', 'Error') ?>: </strong>
<?= h($message) ?>
</p>

View File

@ -0,0 +1,24 @@
<?php
/**
* CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
* Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
*
* Licensed under The MIT License
* For full copyright and license information, please see the LICENSE.txt
* Redistributions of files must retain the above copyright notice.
*
* @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
* @link https://cakephp.org CakePHP(tm) Project
* @since 0.10.0
* @license https://opensource.org/licenses/mit-license.php MIT License
*/
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html>
<head>
<title><?= $this->fetch('title') ?></title>
</head>
<body>
<?= $this->fetch('content') ?>
</body>
</html>

Some files were not shown because too many files have changed in this diff Show More