src/Database/SkeModel.php
public function save(SkeVent &$skeVent)
    {
        $mReturn = false;

        // Validate
        if ($this->validateEvent($skeVent)) {
            $aValues = $skeVent->toArray(false);
            unset($aValues['lead_time_num'], $aValues['lead_time_unit']);

            // Run transaction
            $this->beginTransaction();
            try {
                $mReturn = $this->saveEvent($aValues);
                $this->saveEventTags($mReturn, $skeVent->getTags());
                $this->saveEventMembers($mReturn, $skeVent->getMembers());
            } catch (\Exception $e) {
                $mReturn = false;
                $skeVent->addError(2, $e->getMessage());
            }
            $this->endTransaction((bool)$mReturn);
        }

        return $mReturn;
    }
public function save(SkeVent &$skeVent)
    {
        $mReturn = false;

        // Validate
        if ($this->validateEvent($skeVent)) {
            $aValues = $skeVent->toArray(false);
            unset($aValues['lead_time_num'], $aValues['lead_time_unit']);

            // Run transaction
            $this->beginTransaction();
            try {
                $mReturn = $this->saveEvent($aValues);
                $this->saveEventTags($mReturn, $skeVent->getTags());
                $this->saveEventMembers($mReturn, $skeVent->getMembers());
            } catch (\Exception $e) {
                $mReturn = false;
                $skeVent->addError(2, $e->getMessage());
            }
            $this->endTransaction((bool)$mReturn);
        }

        return $mReturn;
    }
public function save ( SkeVent & $ skeVent ) { $ mReturn = false ; // Validate if ( $ this -> validateEvent ( $ skeVent ) ) { $ aValues = $ skeVent -> toArray ( false ) ; unset ( $ aValues [ 'lead_time_num' ] , $ aValues [ 'lead_time_unit' ] ) ; // Run transaction $ this -> beginTransaction ( ) ; try { $ mReturn = $ this -> saveEvent ( $ aValues ) ; $ this -> saveEventTags ( $ mReturn , $ skeVent -> getTags ( ) ) ; $ this -> saveEventMembers ( $ mReturn , $ skeVent -> getMembers ( ) ) ; } catch ( \ Exception $ e ) { $ mReturn = false ; $ skeVent -> addError ( 2 , $ e -> getMessage ( ) ) ; } $ this -> endTransaction ( ( bool ) $ mReturn ) ; } return $ mReturn ; }
Persist data to the database.

@param CampusUnion\Sked\SkeVent $skeVent Passed by reference.
@return int|bool Success/failure.
Persist data to the database .