src/Common/Model/Base.php
public function createMany(array $aData)
    {
        $oDb = Factory::service('Database');
        try {
            $oDb->trans_begin();
            foreach ($aData as $aDatum) {
                if (!$this->create($aDatum)) {
                    throw new ModelException('Failed to create item with data: ' . json_encode($aDatum));
                }
            }
            $oDb->trans_commit();
            return true;
        } catch (\Exception $e) {
            $oDb->trans_rollback();
            $this->setError($e->getMessage());
            return false;
        }
    }
public function createMany(array $aData)
    {
        $oDb = Factory::service('Database');
        try {
            $oDb->trans_begin();
            foreach ($aData as $aDatum) {
                if (!$this->create($aDatum)) {
                    throw new ModelException('Failed to create item with data: ' . json_encode($aDatum));
                }
            }
            $oDb->trans_commit();
            return true;
        } catch (\Exception $e) {
            $oDb->trans_rollback();
            $this->setError($e->getMessage());
            return false;
        }
    }
public function createMany ( array $ aData ) { $ oDb = Factory :: service ( 'Database' ) ; try { $ oDb -> trans_begin ( ) ; foreach ( $ aData as $ aDatum ) { if ( ! $ this -> create ( $ aDatum ) ) { throw new ModelException ( 'Failed to create item with data: ' . json_encode ( $ aDatum ) ) ; } } $ oDb -> trans_commit ( ) ; return true ; } catch ( \ Exception $ e ) { $ oDb -> trans_rollback ( ) ; $ this -> setError ( $ e -> getMessage ( ) ) ; return false ; } }
Inserts a batch of data into the table

@param array $aData The data to insert

@return bool
Inserts a batch of data into the table