How to store option key names I have to store some properties in a database properties table which looks like this:

CREATE TABLE `property` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `computer_name` varchar(64) NOT NULL,
  `name` varchar(64) NOT NULL,
  `value` varchar(1024) NOT NULL,
  PRIMARY KEY (`id`)
);


Sample data:

+----+---------------+-----------------+-------+
| id | computer_name | name            | value |
+----+---------------+-----------------+-------+
|  9 | PC002         | firewall_status | 3     |
| 10 | PC011         | firewall_status | 0     |
| 11 | PC011         | some_property   | 1     |


To access data in that table I have a getProperty($computerName, $propertyName) method in a repository, which finds the value of specified property for certain computer.
And in different parts of my application I call the method like this: 

$computer = $repository-&gt;findComputer();
$firewallStatus = $repository-&gt;getProperty($computer-&gt;name, 'firewall_status');


What I don't like here is hard coded name of the property.
My solution was to put available property names to a model:

class ComputerModel
{
    const PROPERTY_FIREWALL_STATUS = 'firewall_status';
    const PROPERTY_SOME_PROPERTY   = 'some_property';
}

...

$computer = $repository-&gt;findComputer();
$firewallStatus = $repository-&gt;getProperty($computer-&gt;name, ComputerModel::PROPERTY_FIREWALL_STATUS);


We discussed storing property names as constants and decided that we have some trade-offs:

Good (mostly for code maintanance):


keep the value in one place which make it more simple to change it;
keep available property dictionary in one place (in the model);
make the code completion available in IDE instead of searching for correct property name to copy/paste it;


Not good (mostly for debugging):


by storing a literal values we create extra overhead by storing
variable names in new variables; 
worsen debugging by add one more step to find the object containing debug information;
we need to support additional dictionary; possible data inconsistency if someone adds new value to database but forget to update it in the model.


Subjective:


improves/reduces code readability.


The question is: what is the best way to store such parameter names? Or maybe to use literals.
keep the value in one place which make it more simple to change it


You will never change it (why would you?) so this is not a valid reason. And if you did change it then search/replace works fine.


  keep available property dictionary in one place (in the model)


This looks like MySQL to me. So I suggest using an enum for this instead of a varchar. It will be much faster, take less storage space, prevent invalid values, and have the benefit of storing the dictionary right in the database.


  make the code completion available in IDE instead of searching for correct property name to copy/paste it


This  is nice - however is there no other way to do this? Can you not add some kind of configuration file that will define these?

In the "not good" column I would put adds complexity for little gain. You've taken a string, and turned it back into a different string, only uppercase.

Now, if you were going to store these as integers (i.e. do the equivalent of enum yourself) then making constants has value. You are turning a string into a number, so it actually does something.

So, my suggestion:

Either use enums in your database, and just write them as strings, or store integers, and use the constants.

But don't store these properties as strings.

(BTW, suppose you want to convert from one to the other: Search/replace! I've seen too many cases of overengineering things just from fear of search/replace.)