private function saveSingleProperty( $id, $name, $value )
    {
        $sql = $this->sql( $this->getTableInSchema(
            static::$propertyTableName
        ) );

        $update = $sql->update()
                      ->set( array(
                          'value'   => $value,
                      ) )
                      ->where( array(
                          'menuId'  => $id,
                          'name'    => $name,
                      ) );

        $affected = $sql->prepareStatementForSqlObject( $update )
                        ->execute()
                        ->getAffectedRows();

        if ( $affected < 1 )
        {
            $insert = $sql->insert()
                          ->values( array(
                              'menuId'  => $id,
                              'name'    => $name,
                              'value'   => $value,
                          ) );

            $affected = $sql->prepareStatementForSqlObject( $insert )
                            ->execute()
                            ->getAffectedRows();
        }

        return $affected;
    }
private function saveSingleProperty( $id, $name, $value )
    {
        $sql = $this->sql( $this->getTableInSchema(
            static::$propertyTableName
        ) );

        $update = $sql->update()
                      ->set( array(
                          'value'   => $value,
                      ) )
                      ->where( array(
                          'menuId'  => $id,
                          'name'    => $name,
                      ) );

        $affected = $sql->prepareStatementForSqlObject( $update )
                        ->execute()
                        ->getAffectedRows();

        if ( $affected < 1 )
        {
            $insert = $sql->insert()
                          ->values( array(
                              'menuId'  => $id,
                              'name'    => $name,
                              'value'   => $value,
                          ) );

            $affected = $sql->prepareStatementForSqlObject( $insert )
                            ->execute()
                            ->getAffectedRows();
        }

        return $affected;
    }
private function saveSingleProperty ( $ id , $ name , $ value ) { $ sql = $ this -> sql ( $ this -> getTableInSchema ( static :: $ propertyTableName ) ) ; $ update = $ sql -> update ( ) -> set ( array ( 'value' => $ value , ) ) -> where ( array ( 'menuId' => $ id , 'name' => $ name , ) ) ; $ affected = $ sql -> prepareStatementForSqlObject ( $ update ) -> execute ( ) -> getAffectedRows ( ) ; if ( $ affected < 1 ) { $ insert = $ sql -> insert ( ) -> values ( array ( 'menuId' => $ id , 'name' => $ name , 'value' => $ value , ) ) ; $ affected = $ sql -> prepareStatementForSqlObject ( $ insert ) -> execute ( ) -> getAffectedRows ( ) ; } return $ affected ; }
Save a single property

@param int $id
@param string $name
@param mixed $value
@return int
Save a single property