We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Current I use PHP 5.5 and Phalcon 1.34 need upgrade to PHP 5.6 and Phalcon 2.0.13
I have two models: PackageModel and PackageDetialModel
In PackageModel inside intialilize():
public function initialize() { $this->hasOne(['id', 'referenceTypeID'], PackageDetialModel::class, ['referenceID', 'referenceTypeID'], [ 'alias' => 'detail', ); }
when I get detail by
$list = PackageModel::find(); foreach ($list as $item) { $detail = $item->detail; }
on Phalcon 1.34 will return result but on Phalcon 2.0.13 will return FALSE
The text was updated successfully, but these errors were encountered:
@CodeBanBan Could you please provide table schema?
Sorry, something went wrong.
@sergeyklay thankyou
CREATE TABLE `package` ( `reference_type_id` int(11) NOT NULL, `reference_id` int(10) unsigned NOT NULL, `title` varchar(100) COLLATE utf8_unicode_ci NOT NULL, `created` int(10) unsigned NOT NULL, `updated` int(10) unsigned NOT NULL, `deleted` int(10) unsigned DEFAULT NULL, PRIMARY KEY (`reference_type_id`,`reference_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; INSERT INTO `package` (`reference_type_id`, `reference_id`, `title`, `created`, `updated`, `deleted`) VALUES (1, 1, 'Private Package #1', 0, 0, NULL), (1, 2, 'Private Package #2', 0, 0, NULL), (2, 1, 'Public Package #1', 0, 0, NULL); CREATE TABLE `package_detail` ( `reference_type_id` int(11) NOT NULL, `reference_id` int(10) unsigned NOT NULL, `type` varchar(50) COLLATE utf8_unicode_ci NOT NULL, `value` text COLLATE utf8_unicode_ci NOT NULL, `created` int(10) unsigned NOT NULL, `updated` int(10) unsigned NOT NULL, `deleted` int(10) unsigned DEFAULT NULL, PRIMARY KEY (`reference_type_id`,`reference_id`,`type`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; INSERT INTO `package_detail` (`reference_type_id`, `reference_id`, `type`, `value`, `created`, `updated`, `deleted`) VALUES (1, 1, 'detail', 'private package #1 - detail', 0, 0, NULL), (1, 1, 'option', 'private package #1 - option', 0, 0, NULL), (1, 2, 'detail', 'private package #2 - detail', 0, 0, NULL), (1, 2, 'option', 'private package #2 - option', 0, 0, NULL), (2, 1, 'coupon', 'public package #1 - coupon', 0, 0, NULL), (2, 1, 'detail', 'public package #1 - detail', 0, 0, NULL), (2, 1, 'option', 'public package #1 - option', 0, 0, NULL);
Fixed in the 3.0.x branch.
3.0.x
sergeyklay
No branches or pull requests
Current I use PHP 5.5 and Phalcon 1.34
need upgrade to PHP 5.6 and Phalcon 2.0.13
I have two models: PackageModel and PackageDetialModel
In PackageModel inside intialilize():
when I get detail by
on Phalcon 1.34 will return result
but on Phalcon 2.0.13 will return FALSE
The text was updated successfully, but these errors were encountered: