コード例 #1
0
ファイル: Unique.php プロジェクト: serby/Atrox
 /**
  *
  * @see Core/Data/Atrox_Core_Data_IValidator#validate($value)
  */
 public function validate($value, Atrox_Core_Data_Property $property)
 {
     $dataSource = $property->getDataSource();
     $filter = $property->getDataSource()->makeFilter();
     $filter->addConditional($dataSource->getTableName(), $property->getName(), $value);
     $count = $dataSource->count($filter);
     return $count <= 1 ? true : "'" . $property->getDescription() . "' must be unique. '{$value}' is already used";
 }
コード例 #2
0
ファイル: Connection.php プロジェクト: serby/Atrox
 /**
  *
  * @param Atrox_Core_Data_Property $property
  * @return string
  */
 public function parseProperty(Atrox_Core_Data_Property $property)
 {
     return $this->parseTable($property->getDataSource()->getTableName()) . "." . $this->parseField($property->getName());
 }