Closed
Description
Questions should go to https://forum.phalconphp.com
Documentation issues should go to https://github.com/phalcon/docs/issues
Expected and Actual Behavior
Describe what you are trying to achieve and what goes wrong.
Running this command
phalcon model company --namespace="Incursio\Models" --extends="Baka"
Provide output if related
Warning: PDO::query(): Error reading result set's header in /root/vendor/phalcon/devtools/scripts/Phalcon/Builder/Model.php on line 243
ERROR: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away
By removing this code all works correctly
foreach ($db->describeReferences($tableName, $schema) as $reference) {
244 if ($reference->getReferencedTable() != $this->options->get('name')) {
245 continue;
246 }
247
248 $entityNamespace = '';
249 if ($this->options->contains('namespace')) {
250 $entityNamespace = $this->options->get('namespace')."\\";
251 }
252
253 $refColumns = $reference->getReferencedColumns();
254 $columns = $reference->getColumns();
255 $initialize[] = $this->snippet->getRelation(
256 'hasMany',
257 $this->options->get('camelize') ? Utils::lowerCamelize($refColumns[0]) : $refColumns[0],
258 $entityNamespace . Utils::camelize($tableName),
259 $this->options->get('camelize') ? Utils::lowerCamelize($columns[0]) : $columns[0],
260 "['alias' => '" . Utils::camelize($tableName) . "']"
261 );
262 }
Details
- System info and versions (if possible): (
phalcon info
)
Environment::
OS: Linux localhost.localdomain 3.10.0-514.6.1.el7.x86_64 Easier installation on Linux and OSX #1 SMP Wed Jan 18 13:06:36 UTC 2017 x86_64
PHP Version: 7.0.15
PHP SAPI: cli
PHP Bin: /usr/bin/php
PHP Extension Dir: /usr/lib64/php/modules
PHP Bin Dir: /usr/bin
Loaded PHP config: /etc/php.ini
Versions::
Phalcon DevTools Version: 3.0.4
Phalcon Version: 3.0.4
AdminLTE Version: 2.3.6 - Phalcon Framework version: (
php --ri phalcon
)
3.0.1 - PHP Version: (
php -v
)
PHP 7.0.15 - Operating System:
CentOS - Server: Nginx | Apache | Other
Nginx - Other related info (Database, table schema):