public function batchInsert($data, $runValidation=true)
    {
        foreach ($data as $key => &$attributes) {

            // Validation
            if ($runValidation && false===$attributes=$this->validate($attributes, true))
                return false; 

            $this->_attrEventBeforeInsert($attributes);
        }

        return $this->_db->insert_batch($this->table, $data);
    }
public function batchInsert($data, $runValidation=true)
    {
        foreach ($data as $key => &$attributes) {

            // Validation
            if ($runValidation && false===$attributes=$this->validate($attributes, true))
                return false; 

            $this->_attrEventBeforeInsert($attributes);
        }

        return $this->_db->insert_batch($this->table, $data);
    }
public function batchInsert ( $ data , $ runValidation = true ) { foreach ( $ data as $ key => & $ attributes ) { // Validation if ( $ runValidation && false === $ attributes = $ this -> validate ( $ attributes , true ) ) return false ; $ this -> _attrEventBeforeInsert ( $ attributes ) ; } return $ this -> _db -> insert_batch ( $ this -> table , $ data ) ; }
Insert a batch of rows with Timestamps feature into the associated database table using the attribute values of this record.

@param array $data The rows to be batch inserted
@param boolean $runValidation Whether to perform validation (calling validate()) before manipulate the record.
@return int Number of rows inserted or FALSE on failure
@example
$result = $this->Model->batchInsert([
['name' => 'Nick Tsai', 'email' => 'myintaer@gmail.com'],
['name' => 'Yidas', 'email' => 'service@yidas.com']
]);
Insert a batch of rows with Timestamps feature into the associated database table using the attribute values of this record .