Questions tagged [phalcon-orm]

Object-relational mapping packaged within the Phalcon PHP framework.

52 questions
3
votes
3 answers

Phalcon - Raw Query Insert Syntax error

I've got the following INSERT code : $reservationSuccess = $app->modelsManager->executeQuery( "INSERT INTO MastersReservedTime (master_id, service_id, date, time, desc) VALUES (:master_id:, :service_id:, :date:, :time:, :desc:)", …
Nikita Semenov
  • 2,111
  • 4
  • 18
  • 31
3
votes
1 answer

Model could not be loaded while executing query

I have a query like this: $phsql = " SELECT s.id AS siteId, s.name FROM site s INNER JOIN profiles p ON s.id = p.siteId INNER JOIN users_profiles up ON up.profilesId = p.id AND p.name = 'admin' AND up.usersId =…
Volatil3
  • 14,253
  • 38
  • 134
  • 263
2
votes
1 answer

Phalcon - ORM Updating with save cause duplicate entries

I'm fighting with a problem for a considerable time, and I can't find a nice way to fix my issue. Let's say I have two tables: uses (id, name) uses_phone (id, user_id, phone) Supposing I have created a users (1, 'Mary') and her phones users_phones…
candlejack
  • 1,189
  • 2
  • 22
  • 51
2
votes
2 answers

Phalcon find with conditions of models relation

I have this model code: class TvguideChannel extends Model{ public function initialize() { $this->setSource('tvguide_channel'); $this->setConnectionService('db'); $this->hasMany('code', __NAMESPACE__.'\Tvguide',…
Jajaja
  • 133
  • 1
  • 10
2
votes
1 answer

Phalcon REST API structure

I am developing REST API using Phalcon. The application will have multiple modules like Users, Company, Contacts and so on. Each of these modules have their own tables for storing data. Moreover each module have their own defination file which…
mary josh
  • 21
  • 4
2
votes
1 answer

How to implement multiple conditions for single table column in PhalconPHP

What would be the right syntax to find the sum of money saved in plans where the status is either abanadoned or completed: $total = self::sum([ 'column' => 'amount_saved_so_far', 'conditions' => 'status = "completed" AND user_id =…
divergent
  • 271
  • 4
  • 17
1
vote
2 answers

How to dump the query in Phalcon Framework using Model

$content = Content::findFirst([ 'conditions' => 'state = :state: AND URLid = :url: AND city = :city:', 'bind' => [ 'state' => $geodata_usstates->statecode, 'url' => $company, 'city' => $geodata_geocity->city …
1
vote
1 answer

How to fetch a record having max column value in phalcon?

I am trying to fetch a row/record having max faq_order column. Scenario: I have a table faq_category and it contains a field faq_order. FAQ_ORDER column is responsible for storing the order number. While creating new record in faq_category I want…
Iftikhar uddin
  • 3,117
  • 3
  • 29
  • 48
1
vote
1 answer

cast_on_hydrate ignored when columns are specified in Query Builder

I've run into something quite specific in Phalcon and wondered if someone could take a look and advise if there is a fix? In my bootstrap I have used ini_set() to set the value of cast_on_hydrate ini_set('phalcon.orm.cast_on_hydrate', 'on'); and I'm…
BeesonBison
  • 1,053
  • 1
  • 17
  • 27
1
vote
1 answer

Phalcon ORM field has relation with another field in same table

I have the following table in my mysql DB I have a model Shipment and i am using Phalcon's ORM to interact with my DB. The master_id field in this table is actually the id of another raw, but in the same table, as you can see in the picture. The…
GeorgeGeorgitsis
  • 1,262
  • 13
  • 29
1
vote
0 answers

use Models in Cli in PhalconPHP

I just started out with Phalcon PHP and I have a question. I have a cli app running with the following code: include __DIR__ . '/../vendor/autoload.php'; ... // Load the configuration file (if any) ... $loader = new…
Maarten Raaijmakers
  • 615
  • 2
  • 8
  • 20
1
vote
1 answer

Phalcon datetime in model query error

I am trying to execute a query like this: Select * from table where created_at > DATE_SUB(NOW(), INTERVAL 1 DAY) in phalcon model query form. But i keep getting the following error: Syntax error, unexpected token INTEGER(1), near to ' DAY)', By…
mega-crazy
  • 838
  • 2
  • 17
  • 36
1
vote
1 answer

Phalcon save unable to perform

Phalcon save function is asking required fields even if its available from post. Previously was using tag and everything was working fine and able to do complete CRUD functionality. Now i wanted to implement validation and upgraded code from tag to…
Syed Nizamudeen
  • 440
  • 3
  • 7
  • 25
1
vote
1 answer

Passing variable in conditions of method find() in Phalcon Framework

I'm receiving a variable in my controller and I want make a bind query with the search variable, I try this: $search = $this->request->getPost('term'); $item = Item::find( [ …
nillo
  • 41
  • 1
  • 6
1
vote
1 answer

PhalconPHP ORM gettype error

I'm trying to get settings for a website from MongoDB via PhalconPHP, using an Phalcon\Mvc\Model. Here's my model: namespace CMS4\Common\Model; use Phalcon\Mvc\Model as MongoDocument; class Settings extends MongoDocument { /** * …
1
2 3 4