public function create($pid, $attrs = [])
    {
        $table = $this->getTable();

        $newUid = 'NEW_' . uniqid($table);

        $this->dh->stripslashes_values = 0;
        $this->dh->start([
            $table => [
                $newUid => array_merge($attrs, ['pid' => $pid])
            ]
        ], null);
        $this->dh->process_datamap();

        if (isset($this->dh->substNEWwithIDs[$newUid])) {
            return $this->dh->substNEWwithIDs[$newUid];
        } else {
            return null;
        }
    }
public function create($pid, $attrs = [])
    {
        $table = $this->getTable();

        $newUid = 'NEW_' . uniqid($table);

        $this->dh->stripslashes_values = 0;
        $this->dh->start([
            $table => [
                $newUid => array_merge($attrs, ['pid' => $pid])
            ]
        ], null);
        $this->dh->process_datamap();

        if (isset($this->dh->substNEWwithIDs[$newUid])) {
            return $this->dh->substNEWwithIDs[$newUid];
        } else {
            return null;
        }
    }
public function create ( $ pid , $ attrs = [ ] ) { $ table = $ this -> getTable ( ) ; $ newUid = 'NEW_' . uniqid ( $ table ) ; $ this -> dh -> stripslashes_values = 0 ; $ this -> dh -> start ( [ $ table => [ $ newUid => array_merge ( $ attrs , [ 'pid' => $ pid ] ) ] ] , null ) ; $ this -> dh -> process_datamap ( ) ; if ( isset ( $ this -> dh -> substNEWwithIDs [ $ newUid ] ) ) { return $ this -> dh -> substNEWwithIDs [ $ newUid ] ; } else { return null ; } }
Create a new record under the given PID.

@param  int  $pid
@param  array  $attrs  Set of attributes to add to the record
@return  int|null  UID of created record, or null if creation failed
Create a new record under the given PID .