Translation of Phalcon - EN to TR - (Models Relationships 0% to 100%) - 661 Words Translated
Hello friends,
Here is my contribution to Phalcon in translating the language from English to Turkish. I translated 661 words in total in order to complete my daily task and contribute to help this project be translated into my language as well as possible. I translated the project's both Models Relationships section from 12% to 54%.
What is Phalcon?
Phalcon is a high-performance PHP web framework based on the model–view–controller (MVC) pattern. Originally released in 2012, it is an open-source framework licensed under the terms of the BSD License.
Unlike most PHP frameworks, Phalcon is implemented as a web server extension written in Zephir and C, aiming to boost execution speed, reduce resource usage, and handle more HTTP requests per second than comparable frameworks written primarily in PHP. One drawback of this approach is that root/administrative access is required on the server to install Phalcon by building a custom binary or using a precompiled one.
What is provided with Phlacon?
ORM , Template Engines , ACL and many of these things are provided. Let's explain each one of them.
ORM (Object Relation Mapping)
A powerful ORM is provided by Phalcon allowing you to manipulate database records as classes and objects. MySQL, PostgreSQL and SQLite are supported out of the box.
This is a simple instance of ORM:
Template Engines
Views represent the user interface of your application. Views are often HTML files with embedded PHP code that perform tasks related solely to the presentation of the data. Views handle the job of providing data to the web browser or other tool that is used to make requests from your application.
Here is the example:
ACL (Access Control List)
Access Control List allows users to access the modules they're authorized to
This is an example here:
Here is the translation:
Before
While Translating
After
EN:
Model Relationships
Relationships between Models
There are four types of relationships: one-on-one, one-to-many, many-to-one and many-to-many. The relationship may be unidirectional or bidirectional, and each can be simple (a one to one model) or more complex (a combination of models). The model manager manages foreign key constraints for these relationships, the definition of these helps referential integrity as well as easy and fast access of related records to a model. Through the implementation of relations, it is easy to access data in related models from each record in a uniform way.
Unidirectional relationships
Unidirectional relations are those that are generated in relation to one another but not vice versa.
Bidirectional relations
The bidirectional relations build relationships in both models and each model defines the inverse relationship of the other.
Defining relationships
In Phalcon, relationships must be defined in theinitialize()
method of a model. The methodsbelongsTo()
,hasOne()
,hasMany()
andhasManyToMany()
define the relationship between one or more fields from the current model to fields in another model. Each of these methods requires 3 parameters: local fields, referenced model, referenced fields.
The first parameter indicates the field of the local model used in the relationship; the second indicates the name of the referenced model and the third the field name in the referenced model. You could also use arrays to define multiple fields in the relationship.
Many to many relationships require 3 models and define the attributes involved in the relationship:
TR:
Model İlişkileri
Modeller arasındaki ilişki
Dört çeşit ilişki vardır: bire bir, birden çoka, çoktan bire ve çoktan çoka. İlişki tek yönlü ya da çift yönlü, her biri basit (bire bir model) veya daha karmaşık olabilir (modellerin bir birleşimi). Model yöneticisi bu ilişkiler için yabancı anahtar sınırlamalarını yönetir, bunun tanımlanması referans kayıt bütünlüğünün yanı sıra ilgili kayıtların bir modele kolay ve hızlı bir şekilde erişmesine yardımcı olur. İlişkilerin uygulanması aracılığıyla her bir kayıttan ilgili modellerdeki verilere tek bir biçimde erişmek kolaydır.
Tek yönlü ilişkiler
Tek yönlü ilişkiler birbirleriyle ilişkili olarak üretilen ilişkilerdir ancak tersi değildir.
Çift yönlü ilişkiler
Çift yönlü ilişkiler her iki modelde de ilişkiler kurar ve her model diğerinin ters ilişkisini tanımlar.
İlişkileri tanımlama
Phalcon'da ilişkiler, modelininitialize()
metodunda tanımlanmalıdır.belongsTo()
,hasOne()
,hasMany()
vehasManyToMany()
metodları mevcut modelden başka bir modeldeki alanlarla bir veya daha fazla alan arasındaki ilişkiyi tanımlarlar. Bu yöntemlerin her biri 3 parametre gerektirir: yerel alanlar, başvurulan model, başvurulan alanlar.
İlk parametre ilişkide kullanılan yerel modelin alanını belirtir; ikinci parametre, başvurulan modelin adını belirtir ve üçüncü parametre ise başvurulan modeldeki alan adını belirtir. İlişkide birden fazla alan tanımlamak için dizileri kullanabilirsiniz.
Çoktan çoka ilişkiler 3 model gerektirir ve ilişkide bulunan nitelikleri tanımlar:
Proof Link
My Crowdin Profile
Phalcon - Crowdin
Phalcon - Github
Posted on Utopian.io - Rewarding Open Source Contributors
Thank you for the contribution. It has been approved.
You can contact us on Discord.
[utopian-moderator]
Hey @sym I am @utopian-io. I have just upvoted you!
Achievements
Suggestions
Get Noticed!
Community-Driven Witness!
I am the first and only Steem Community-Driven Witness. Participate on Discord. Lets GROW TOGETHER!
Up-vote this comment to grow my power and help Open Source contributions like this one. Want to chat? Join me on Discord https://discord.gg/Pc8HG9x