TwistPHP Documentation

copy

File path: dist/twist/Core/Models/Database/Records.model.php
Namespace: Twist\Core\Models\Database
Extends:

copyGet a clone of a database record as an object to be stored as a new record (auto-increment fields will be nulled). The cloned record will not be created/stored until commit has been called on the returned record object.
If the filter value contains a '%' it will be filtered as a LIKE, if the value contains an array it will be imploded and filtered as an IN otherwise filtering will be done as an EQUALS.

Parameters

Name Type Description
$mxdValuemixedn/a
[$strField = 'id']stringn/a

Return Values

void — No return information has been documented for this function.

Example

<?php
//Set the variables for the example
$mxdValue 'foo-123';
$strField 'id';

//Call the function copy with the example vars
$resRecords = new \Twist\Core\Models\Database\Records();
$resRecords -> copy($mxdValue$strField);