src/behaviors/HasProperties.php
public function beforeDelete()
    {
        // properties assigned to this record
        /** @var \yii\db\ActiveRecord|\DevGroup\DataStructure\traits\PropertiesTrait $owner */
        $owner = $this->owner;
        $event = new HasPropertiesEvent();
        $event->model = $owner;
        HasPropertiesEvent::trigger(self::class, self::EVENT_BEFORE_DELETE, $event);
        //! @todo add check if this object doesn't has related properties that we wish to delete(lower db queries)
        $array = [&$owner];
        PropertiesHelper::deleteAllProperties($array);
        unset($array);

        return true;
    }
public function beforeDelete()
    {
        // properties assigned to this record
        /** @var \yii\db\ActiveRecord|\DevGroup\DataStructure\traits\PropertiesTrait $owner */
        $owner = $this->owner;
        $event = new HasPropertiesEvent();
        $event->model = $owner;
        HasPropertiesEvent::trigger(self::class, self::EVENT_BEFORE_DELETE, $event);
        //! @todo add check if this object doesn't has related properties that we wish to delete(lower db queries)
        $array = [&$owner];
        PropertiesHelper::deleteAllProperties($array);
        unset($array);

        return true;
    }
public function beforeDelete ( ) { // properties assigned to this record /** @var \yii\db\ActiveRecord|\DevGroup\DataStructure\traits\PropertiesTrait $owner */ $ owner = $ this -> owner ; $ event = new HasPropertiesEvent ( ) ; $ event -> model = $ owner ; HasPropertiesEvent :: trigger ( self :: class , self :: EVENT_BEFORE_DELETE , $ event ) ; //! @todo add check if this object doesn't has related properties that we wish to delete(lower db queries) $ array = [ & $ owner ] ; PropertiesHelper :: deleteAllProperties ( $ array ) ; unset ( $ array ) ; return true ; }
Deletes related properties from database
@return bool
Deletes related properties from database