Download the PHP package phoenixrvd/oda without Composer

On this page you can find all versions of the php package phoenixrvd/oda. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package oda

Object Data Accessor (ODA)

Minimum PHP Version Latest Stable Version composer.lock License

Build Status Code Climate StyleCI Test Coverage BCH compliance Latest Unstable Version

Features

Installation

Bei der Installation ist Composer vorausgesetzt.

Basics

Angenommen, braucht man ein ein Objekt, welches genau 2 Datenfelder hat (foo und bar).

Deklariert man Standard-Methoden, wird das Objekt wie Folgt aussehen:

Hätte man nicht 2 sondern 10 Properties, wird das Object gleich um 300 LOC länger.

Nutzt man das Packet, bekommt man gleiche Funktionalität wesentlich kompakter. Auch wenn anzahl von Datenfelder wächst, vergrößert man nicht den Code-Basis.

Im Beispiel Unten ist vorheriges Objekt umgeschrieben:

IDE-Helper

Damit die IDE auch alle Objekt-Methoden kennt und man Autovervollständigung nutzen kann, sollte man die Methoden in der Klasse-Signatur festlegen.

Es ist aber immer noch kompakter als vorher.

Standard-Accessoren

Standard-Präfixes:

Präfix Beschreibung
get Gibt Wert eines Feldes zurück
set Setzt Wert eines Feldes
is(value) Prüftob Wert exakt dem Parameter entspricht (Vergleich mit )
has Prüft ob das Objekt ein Feld für Daten enthält (Equivalent: )
asJSON Gibt Wert eines Feldes als formatiertes JSON-String zurück.

Eigene-Accessoren

Manchmal braucht man, dass bestimmte Felder eines Objektes formatiert zurückgegeben werden.

Z.b. ist Unix-Timestamp, man braucht es aber als RFC822-Datum.

Im Bespiel ist beschrieben, wie man der API ein date - Accessor beibringt. Damit wird voll automatisch Unix-Timestamp nach Datum konvertieren und man es mit überall verwenden kann.

Beispiel

  1. Accessor-Klasse anlegen

  2. Trait für Wiederverwendbarkeit anlegen

  3. Eigenes Trait an Stelle von Standard-Trait im Object verwenden.

  4. Einfach die Methode aufrufen

Hinweis

Projekte, die auf sehr hohe Leistung ausgelegt sind, sollten auf die Methodik generell verzichten. Diskussion dazu findet man hier.

Testing

Copyright and license

Code released under the MIT License.


All versions of oda with dependencies

PHP Build Version
Package Version
Requires php Version >=5.6
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package phoenixrvd/oda contains the following files

Loading the files please wait ....