Example #1
0
 public function __construct(SimDAL_Mapper_Entity $entity, $property, $fieldname, $datatype, $primarykey = false, $autoincrement = false, $alias = null)
 {
     $this->_entity = $entity;
     $this->_class = $entity->getClass();
     $this->_table = $entity->getTable();
     $this->_schema = $this->getSchema();
     $this->_property = $property;
     $this->_fieldName = $fieldname;
     $this->_dataType = $datatype;
     $this->_primaryKey = $primarykey;
     $this->_autoIncrement = $autoincrement;
     $this->_alias = $alias;
 }
Example #2
0
 protected function _processDeleteQuery(SimDAL_Mapper_Entity $mapping, $id)
 {
     $pk = $mapping->getPrimaryKeyColumn();
     $sql = "DELETE FROM " . $this->_quoteIdentifier($mapping->getTable()) . " WHERE `{$pk->getColumn()}`=" . $id;
     return $sql;
 }
Example #3
0
 /**
  * @return SimDAL_Mapper_Entity
  */
 public function getFrom()
 {
     return $this->_from->getTable();
 }
Example #4
0
 public function getRightValue()
 {
     return new SimDAL_Query_Where_Column($this->_entity->getTable(), $this->_entity->getColumn($this->_descendant->getParentKey()));
 }
Example #5
0
 protected function _processInsertQuery(SimDAL_Mapper_Entity $mapping, $data)
 {
     $sql = "INSERT INTO " . $this->_quoteIdentifier($mapping->getTable()) . " (" . implode(',', array_keys($data)) . ") VALUES (" . implode(',', $data) . ")";
     return $sql;
 }
Example #6
0
 protected function _processInsertQuery(SimDAL_Mapper_Entity $mapping, $data)
 {
     $sql = "INSERT INTO " . $this->_quoteIdentifier($mapping->getTable()) . " ('" . implode('\',\'', array_keys($data)) . "') VALUES (";
     foreach ($data as $key => $value) {
         $sql .= ':' . $key . ',';
     }
     $sql = substr($sql, 0, -1) . ')';
     $stmt = $this->_conn->prepare($sql);
     foreach ($data as $key => $value) {
         $stmt->bindParam(':' . $key, $value);
     }
     return $stmt;
 }