drwrf/mismatch-orm

A simple library for complex SQL.

0.3.3 2014-11-22 21:14 UTC

This package is not auto-updated.

Last update: 2024-12-17 04:26:51 UTC


README



        ███╗   ███╗██╗███████╗███╗   ███╗ █████╗ ████████╗ ██████╗██╗  ██╗
        ████╗ ████║██║██╔═══                         █╔══╝██╔════╝██║  ██║╗
        ██╔████╔██║██║██████       Mismatch\ORM      █║   ██║     ███████║╝
        ██║╚██╔╝██║██║╚════█_________________________█║   ██║     ██╔══██║╗
        ██║ ╚═╝ ██║██║███████║██║ ╚═╝ ██║██║  ██║   ██║   ╚██████╗██║  ██║╝
        ╚═╝     ╚═╝╚═╝╚══════╝╚═╝     ╚═╝╚═╝  ╚═╝   ╚═╝    ╚═════╝╚═╝  ╚═╝

         A   S I M P L E   L I B R A R Y   F O R   C O M P L E X   S Q L

         ╚═════════════════════════════════════════════════════════════╝

          The goal of Mismatch\ORM is to make building and executing SQL
          queries dead simple. It optimizes for the common scenarios,
          while allowing you to fall back to straight SQL when necessary.

          You see, SQL is actually pretty good at its job and you really
          shouldn't have to work around your ORM to get at it.

          Let's take a look.

                                         ~
          <?php

          use Mismatch\ORM\Query;
          use Mismatch\ORM\Expression as e;

          $authors = (new Query($conn, 'authors'))
            ->order('name', 'asc')
            ->where([
              'signup' => e\after('2014-04-01')
              'active' => true,
            ]);

          foreach ($authors as $author) {
            // It's pretty easy
          }