예제 #1
0
파일: Column.php 프로젝트: andho/simdal
 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;
 }
예제 #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;
 }
예제 #3
0
파일: Query.php 프로젝트: andho/simdal
 /**
  * @return SimDAL_Mapper_Entity
  */
 public function getFrom()
 {
     return $this->_from->getTable();
 }
예제 #4
0
파일: Join.php 프로젝트: andho/simdal
 public function getRightValue()
 {
     return new SimDAL_Query_Where_Column($this->_entity->getTable(), $this->_entity->getColumn($this->_descendant->getParentKey()));
 }
예제 #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;
 }
예제 #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;
 }