Name::class
/**
* @ORM\Entity
* @ORM\Table(name="teachers")
*/
class Teacher implements AggregateRoot
{
use EventsTrait;
/**
* @ORM\Embedded(class="\App\StudentSystem\Entity\Teacher\Name", columnPrefix=false)
*/
private Name $name;
}
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Embeddable
*/
class Name
{
/**
* @ORM\Column(type="string")
*/
private string $firstName;
/**
* @ORM\Column(type="string")
*/
private string $lastName;
/**
* @ORM\Column(type="string", nullable=true)
*/
private ?string $middleName;
public function __construct(string $firstName, string $lastName, ?string $middleName = null)
{
$this->firstName = $firstName;
$this->lastName = $lastName;
$this->middleName = $middleName;
}
public function getFirstName(): string
{
return $this->firstName;
}
public function getLastName(): ?string
{
return $this->lastName;
}
public function getMiddleName(): ?string
{
return $this->middleName;
}
}
docker-compose run --rm lms-php-cli php bin/console do:mi:mi
PDO::__construct(): php_network_getaddresses: getaddrinfo failed: Name or service not known
DATABASE_URL=mysql://app:secret@lms-mylsq:3306/app
doctrine:
dbal:
# configure these for your database server
driver: 'pdo_mysql'
server_version: '8.0'
charset: utf8
default_table_options:
charset: utf8
collate:
url: '%env(resolve:DATABASE_URL)%'
lms-mysql:
image: mysql:8.0
volumes:
- lms-mysql:/var/lib/mysql/data
environment:
MYSQL_USER: app
MYSQL_ROOT_PASSWORD: secret
MYSQL_PASSWORD: secret
MYSQL_DATABASE: app
ports:
- "3306:3306"
command: "--default-authentication-plugin=mysql_native_password"
Fatal error: Uncaught Error: Call to a member function getVersions() on null in /app/vendor/symfony/flex/src/Cache.php:118
Stack trace:
#0 /app/vendor/symfony/flex/src/Cache.php(58): Symfony\Flex\Cache->getVersions()
#1 /app/vendor/symfony/flex/src/TruncatedComposerRepository.php(41): Symfony\Flex\Cache->removeLegacyTags(Array)
#2 phar:///bin/composer/src/Composer/Repository/Compo...: Symfony\Flex\TruncatedComposerRepository->fetchFile('repo.pac...', 'provider-parago...', '26630b38ee10ef6...', false)
#3 /app/vendor/symfony/flex/src/Flex.php(538): Composer\Repository\ComposerRepository->whatProvides(Object(Composer\DependencyResolver\Pool), 'paragonie/rando...', false)
#4 phar:///bin/composer/src/Composer/DependencyResolv...: class@anonymous->whatProvides(Object(Composer\DependencyResolver\Pool), 'paragonie/rando...', false)
#5 phar:///bin/composer/src/Composer/DependencyResolv...: Composer\DependencyResolver\Pool->computeWhatProvides('paragonie/rando...', Object(Composer in /app/vendor/symfony/flex/src/Cache.php on line 118
/**
* @Route("/profile/oauth")
*/
config/packages/sensio_framework_extra.yaml
Не помогало( {
"type": "project",
"license": "proprietary",
"require": {
"php": "^7.4.0",
"ext-PDO": "^7.4",
"ext-ctype": "*",
"ext-iconv": "*",
"ext-json": "*",
"cebe/markdown": "^1.2",
"exercise/htmlpurifier-bundle": "^2.0",
"finesse/swiftmailer-defaults-plugin": "^2.0",
"knplabs/knp-menu-bundle": "dev-master",
"knplabs/knp-paginator-bundle": "^4.0",
"knpuniversity/oauth2-client-bundle": "^1.28",
"league/flysystem-bundle": "^1.1",
"league/oauth2-facebook": "^2.0",
"nyholm/psr7": "^1.1",
"ramsey/uuid": "^4.1.1",
"sensio/framework-extra-bundle": "^5.1",
"symfony/asset": "5.2.*",
"symfony/console": "5.2.*",
"symfony/dotenv": "5.2.*",
"symfony/expression-language": "5.2.*",
"symfony/flex": "^v1.12.0",
"symfony/form": "5.2.*",
"symfony/framework-bundle": "5.2.*",
"symfony/messenger": "5.2.*",
"symfony/monolog-bundle": "^3.1",
"symfony/orm-pack": "*",
"symfony/process": "5.2.*",
"symfony/security-bundle": "5.2.*",
"symfony/serializer-pack": "*",
"symfony/swiftmailer-bundle": "5.2.*",
"symfony/translation": "5.2.*",
"symfony/twig-bundle": "5.2.*",
"symfony/validator": "5.2.*",
"symfony/web-link": "5.2.*",
"symfony/webpack-encore-bundle": "^1.11",
"symfony/yaml": "5.2.*",
"trikoder/oauth2-bundle": "^2.0",
"webmozart/assert": "^1.9"
},
"require-dev": {
"doctrine/doctrine-fixtures-bundle": "^3.1",
"fzaninotto/faker": "^1.8",
"symfony/debug-pack": "*",
"symfony/maker-bundle": "^1.0",
"symfony/profiler-pack": "*",
"symfony/test-pack": "*"
},
"config": {
"preferred-install": {
"*": "dist"
},
"sort-packages": true
},
"autoload": {
"psr-4": {
"App\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"App\\Tests\\": "tests/"
}
},
"replace": {
"paragonie/random_compat": "2.*",
"symfony/polyfill-ctype": "*",
"symfony/polyfill-iconv": "*",
"symfony/polyfill-php71": "*",
"symfony/polyfill-php70": "*",
"symfony/polyfill-php56": "*"
},
"scripts": {
"auto-scripts": {
"cache:clear": "symfony-cmd",
"assets:install %PUBLIC_DIR%": "symfony-cmd"
},
"post-install-cmd": [
"@auto-scripts"
],
"post-update-cmd": [
"@auto-scripts"
]
},
"conflict": {
"symfony/symfony": "*"
},
"extra": {
"symfony": {
"allow-contrib": false,
"require": "5.2.*"
}
}
}
to_char(to_timestamp(from_at)::timestamp, 'YYYY-MM-DD 00:00:00') AS "date" //2020-12-27 00:00:00
. Так работает, но теперь эту дату нужно преобразовать обратно в unix. При использовании такой конструции EXTRACT(EPOCH FROM to_char(to_timestamp(from_at)::timestamp, 'YYYY-MM-DD 00:00:00')) AS "date"
получается ошибка [42883] ERROR: function pg_catalog.date_part(unknown, text) does not exist Подсказка: No function matches the given name and argument types. You might need to add explicit type casts. Позиция: 16