if ($this->taste_array) {
foreach ($this->taste_array as $one) {
if (!in_array($one, $arr)) {
$model = ($model = HasProductTaste::find()
->where(['product_id' => $this->id])
->andWhere(['taste_id' => $one])
->one()) ? $model : new HasProductTaste();
$model->product_id = $this->id;
$model->taste_id = $one;
$model->save();
}
if (isset($arr[$one])) {
unset($arr[$one]);
}
}
}
sudo apt-get install php5-xdebug -y
sudo nano /etc/php5/mods-available/xdebug.ini
zend_extension=xdebug.so
xdebug.default_enable=1
xdebug.var_display_max_depth=6
xdebug.remote_enable=1
xdebug.remote_host=localhost
xdebug.remote_port=9000
xdebug.remote_handler=dbgp
xdebug.remote_autostart=1
xdebug.remote_log=/tmp/xdebug.log
xdebug.idekey="PHPSTORM"
xdebug.profiler_enable_trigger=1
xdebug.profiler_enable=0
xdebug.profiler_output_dir=/tmp/profiler
xdebug.show_local_vars=1
xdebug.overload_var_dump=1