]> rtime.felk.cvut.cz Git - edu/osp-wiki.git/blobdiff - student/dendimar/index.mdwn
lectures: minor update of link to LinuxDays 2023 presentation listing.
[edu/osp-wiki.git] / student / dendimar / index.mdwn
index 62549185d6f5eb6e0a2ae8ab21f8cd9e0854fcb1..ee8d06dad56d642fbab6f73f21038ff7a1cb2d8d 100644 (file)
@@ -1,16 +1,34 @@
 [[!meta title="Dendis Martin"]]
 
-**Project name and homepage:** [Nette](http://nette.org)
+**Project name and homepage:** [Nette Framework](http://nette.org/)
 
 Assignment
 ======
 
 I'd like to help fix some bugs in database layout I've discovered
 
-1. [Quick access to real row count](https://sourceforge.net/p/phpmyadmin/feature-requests/1448/)
-2. [Easy access to SHOW CREATE](https://sourceforge.net/p/phpmyadmin/feature-requests/1445/)
-3. [Remove the distinct query window](https://sourceforge.net/p/phpmyadmin/feature-requests/1492/)
-4. [Support InnoDB for database Query by example](https://sourceforge.net/p/phpmyadmin/feature-requests/1491/)
+(a) If I have in database column with type time/timeint, database layout will return it's values as instance of class DateInterval. But when I want to insert or update this column, database layout can't process DateInterval & crashes.
+See the example:
+
+    // This works just fine
+    $actRow = $this->connection->table('test')->insert(array('time' => '1:30:00'));
+
+    // But this will crash, because database layout can't deal with class DateInterval on insert or update
+    $actRow = $this->connection->table('test')->insert(array('time' => new \DateInterval('PT1H30M')));
+
+    // On the other hand
+    $actRow = $this->connection->table('test')->insert(array('time' => '1:30:00'));
+    echo $actRow['time'] instanceof \DateInterval ? 'Yes' : 'No'; // Will print Yes
+
+(b) If I'm working with ActivRow and I want to update column which is defined as primary key the app crashes. It's because after each update of ActiveRow database layout fetches (refreshes) row from database, but with old values of primary keys. Seethe example:
+
+    // In database I have in table test defined column id as primary key
+    $actRow = $this->connection->table('test')->insert(array('username' => 'marek'));
+
+    // This operation will fail, the data in the database has been modified
+    // But after update, database layout will try to refresh ActiveRow from database 
+    // and use old primary key 'marek' instead of new one 'ondra' so no record is found and exception is thrown
+    $actRow->update(array('username' => 'ondra'));
 
 and maybe some others...
  
@@ -18,22 +36,20 @@ and maybe some others...
 Links documenting the results of my work
 ======
 
-Here, I'll add links similar to the examples below and describe what
-is being linked.
-
+1. [Nette\Database - Problem with \DateInterval object on insert/update](https://github.com/nette/database/issues/56) (rejected - David Grudl solved my problem before I could do it by myself, even though I asked about the possibility of my own implementation.)
+2. [Nette\Database - ActiveRow problem with update of primary key](https://github.com/nette/database/issues/57) (merged)
+3. [Nette\Deprecated - Added .gitattributes file](https://github.com/nette/deprecated/pull/3) (merged - so composer will not download test & other files in non-dev mode)
+4. [Zenify\DoctrineMigrations - Added support for PHP 5.4](https://github.com/Zenify/DoctrineMigrations/pull/12) (rejected - I've started working on it a several weeks ago, but when I finally created merge-request, then I found out that somebody else was faster than me)
 
-Presentation
+Presentations
 ==========
-
+1. [[Presentation_of_the_aim_of_my_work.pdf]]
+2. [[Presentation_of_the_results_of_my_work.pdf]]
 
 Ohloh
 =====
 
-Here, I'll fill in the HTML code of the [Ohloh widgetu][w] showing my KudoRank.
-
-For example:
-
-[w]:https://www.ohloh.net/accounts/dendimar/widgets
+Registration into openhub.net is not working anymore.
 
 
-  [1]: https://sourceforge.net/p/phpmyadmin/feature-requests/1491/
+  [1]: https://github.com/Zenify/DoctrineMigrations/pull/12