public function insert(array $data)
    {
        $params = array();
        $query = "INSERT INTO $this->_name (";

        foreach ($data as $key => $value) {
            $query .= "$key, ";

        }

        $query = substr($query, 0, -2);
        $query .= ") VALUES (";

        $iValue = 0;
        foreach ($data as $key => $value) {
            $query .= ":value$iValue, ";
            $params[":value$iValue"] = $value;
            $iValue++;
        }

        $query = substr($query, 0, -2);
        $query .= ")";

        return $this->_insert($query, $params);
    }
public function insert(array $data)
    {
        $params = array();
        $query = "INSERT INTO $this->_name (";

        foreach ($data as $key => $value) {
            $query .= "$key, ";

        }

        $query = substr($query, 0, -2);
        $query .= ") VALUES (";

        $iValue = 0;
        foreach ($data as $key => $value) {
            $query .= ":value$iValue, ";
            $params[":value$iValue"] = $value;
            $iValue++;
        }

        $query = substr($query, 0, -2);
        $query .= ")";

        return $this->_insert($query, $params);
    }
public function insert ( array $ data ) { $ params = array ( ) ; $ query = "INSERT INTO $this->_name (" ; foreach ( $ data as $ key => $ value ) { $ query .= "$key, " ; } $ query = substr ( $ query , 0 , - 2 ) ; $ query .= ") VALUES (" ; $ iValue = 0 ; foreach ( $ data as $ key => $ value ) { $ query .= ":value$iValue, " ; $ params [ ":value$iValue" ] = $ value ; $ iValue ++ ; } $ query = substr ( $ query , 0 , - 2 ) ; $ query .= ")" ; return $ this -> _insert ( $ query , $ params ) ; }
Create new row
@param array $data Array with data ('column_name' => 'foo')
@return \Core\Orm\RowGateway | bool
Create new row