public function createOne($data)
    {
        // Event
        $this->triggerEvent(
            'onBefore' . ucfirst(__FUNCTION__),
            [
                'data' => &$data,
            ]
        );

        $dataset = $this->create($this->bindDataset([$data]));

        $result = $dataset[0];

        // Event
        $this->triggerEvent(
            'onAfter' . ucfirst(__FUNCTION__),
            [
                'result' => &$result,
            ]
        );

        return $result;
    }
public function createOne($data)
    {
        // Event
        $this->triggerEvent(
            'onBefore' . ucfirst(__FUNCTION__),
            [
                'data' => &$data,
            ]
        );

        $dataset = $this->create($this->bindDataset([$data]));

        $result = $dataset[0];

        // Event
        $this->triggerEvent(
            'onAfter' . ucfirst(__FUNCTION__),
            [
                'result' => &$result,
            ]
        );

        return $result;
    }
public function createOne ( $ data ) { // Event $ this -> triggerEvent ( 'onBefore' . ucfirst ( __FUNCTION__ ) , [ 'data' => & $ data , ] ) ; $ dataset = $ this -> create ( $ this -> bindDataset ( [ $ data ] ) ) ; $ result = $ dataset [ 0 ] ; // Event $ this -> triggerEvent ( 'onAfter' . ucfirst ( __FUNCTION__ ) , [ 'result' => & $ result , ] ) ; return $ result ; }
Create one record by data object.

@param mixed $data Send a data in and store.

@throws \InvalidArgumentException
@return  mixed|Data Data with inserted id.
Create one record by data object .